mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-01 18:57:24 +00:00
Replaces inheritdoc with explicit documentation
This commit is contained in:
1 parent
8f3304d231
commit
0e0e67ca73
40 files changed
+243
-61
No files matched your search
+26
-5
@@ -38,31 +38,52 @@ public struct HashedFileSystemFileDto : IEquatable<HashedFileSystemFileDto>
|
||||
/// </summary>
|
||||
public long Ticks { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Indicates whether the current object is equal to another object of the same type.
|
||||
/// </summary>
|
||||
/// <param name="other">An object to compare with this object.</param>
|
||||
/// <returns><see langword="true"/> if the current object is equal to the <paramref name="other"/> parameter, <see langword="false"/> otherwise.</returns>
|
||||
public readonly bool Equals(HashedFileSystemFileDto other)
|
||||
{
|
||||
return Size == other.Size && CurrentHash == other.CurrentHash && OldHash == other.OldHash && Ticks == other.Ticks && Path == other.Path;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Determines whether the specified object is equal to the current object.
|
||||
/// </summary>
|
||||
/// <param name="obj">The object to compare with the current object.</param>
|
||||
/// <returns><see langword="true"/> if the specified object is equal to the current object, <see langword="false"/> otherwise.</returns>
|
||||
public override readonly bool Equals(object? obj)
|
||||
{
|
||||
return obj is HashedFileSystemFileDto item && Equals(item);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Custom implementation of the equality operator.
|
||||
/// </summary>
|
||||
/// <param name="left">The left operand of equality.</param>
|
||||
/// <param name="right">The right operand of equality.</param>
|
||||
/// <returns><see langword="true"/> if <paramref name="left"/> is equal to <paramref name="right"/>, <see langword="false"/> otherwise.</returns>
|
||||
public static bool operator ==(HashedFileSystemFileDto left, HashedFileSystemFileDto right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Custom implementation of the inequality operator.
|
||||
/// </summary>
|
||||
/// <param name="left">The left operand of equality.</param>
|
||||
/// <param name="right">The right operand of equality.</param>
|
||||
/// <returns><see langword="true"/> if <paramref name="left"/> is not equal to <paramref name="right"/>, <see langword="false"/> otherwise.</returns>
|
||||
public static bool operator !=(HashedFileSystemFileDto left, HashedFileSystemFileDto right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Serves as the default hash function.
|
||||
/// </summary>
|
||||
/// <returns>A hash code for the current object.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(Size, CurrentHash, OldHash, Ticks, Path);
|
||||
|
||||
@@ -89,7 +89,10 @@ public abstract class BaseMetadata : ValueObject
|
||||
OriginalLanguage = originalLanguage;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Title;
|
||||
|
||||
@@ -41,7 +41,10 @@ public class Genre : ValueObject
|
||||
return new Genre(name);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Name;
|
||||
|
||||
@@ -63,7 +63,10 @@ public class LanguageInfo : ValueObject
|
||||
return new LanguageInfo(languageCode, languageName, nativeName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return LanguageCode;
|
||||
|
||||
@@ -101,7 +101,10 @@ public class ReleaseInfo : ValueObject
|
||||
return new ReleaseInfo(originalReleaseDate, originalReleaseYear, reReleaseDate, reReleaseYear, releaseCountry, releaseVersion);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return OriginalReleaseDate;
|
||||
|
||||
@@ -42,7 +42,10 @@ public class Tag : ValueObject
|
||||
return new Tag(name);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Name;
|
||||
|
||||
+4
-1
@@ -138,7 +138,10 @@ public class AudioMetadata : BaseMetadata
|
||||
bitrate);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
foreach (object component in base.GetEqualityComponents())
|
||||
|
||||
+4
-1
@@ -28,7 +28,10 @@ public sealed class FileSystemPathId : ValueObject
|
||||
Path = path;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Path;
|
||||
|
||||
+4
-1
@@ -58,7 +58,10 @@ public class PathSegment : ValueObject
|
||||
return new PathSegment(name, isDirectory, isDrive);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Name;
|
||||
|
||||
+4
-1
@@ -119,7 +119,10 @@ public class StreamInfo : ValueObject
|
||||
return new StreamInfo(streamId, mimeType, bitrate, codec, resolution, frameRate, sampleRate, channels);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return StreamId;
|
||||
|
||||
+4
-1
@@ -34,7 +34,10 @@ public class Thumbnail : ValueObject
|
||||
Bytes = bytes;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Type;
|
||||
|
||||
+4
-1
@@ -40,7 +40,10 @@ public sealed class LibraryId : EntityId<Guid>
|
||||
return new LibraryId(value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
|
||||
+4
-1
@@ -45,7 +45,10 @@ public sealed class MediaLibraryScanCompositeId : ValueObject
|
||||
return new MediaLibraryScanCompositeId(scanId, userId);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return ScanId;
|
||||
|
||||
+4
-1
@@ -69,7 +69,10 @@ public sealed class MediaLibraryScanJobProgress : ValueObject
|
||||
return new MediaLibraryScanJobProgress(completedItems, totalItems, currentOperation);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return CompletedItems;
|
||||
|
||||
+4
-1
@@ -117,7 +117,10 @@ public sealed class MediaLibraryScanProgress : ValueObject
|
||||
return new MediaLibraryScanProgress(scanId, userId, libraryId, completedJobs, totalJobs, status, currentJobProgress);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return CompletedJobs;
|
||||
|
||||
+4
-1
@@ -40,7 +40,10 @@ public sealed class ScanId : EntityId<Guid>
|
||||
return new ScanId(value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
|
||||
+4
-1
@@ -46,7 +46,10 @@ public sealed class MediaContributorName : ValueObject
|
||||
return new MediaContributorName(displayName, legalName);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return DisplayName;
|
||||
|
||||
+5
-2
@@ -40,9 +40,12 @@ public sealed class MediaContributorId : EntityId<Guid>
|
||||
return new MediaContributorId(value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
-2
@@ -45,10 +45,13 @@ public sealed class MediaContributorRole : ValueObject
|
||||
return new MediaContributorRole(name, category);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Name;
|
||||
yield return Category;
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -40,7 +40,10 @@ public sealed class UserId : EntityId<Guid>
|
||||
return new UserId(value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
|
||||
+4
-1
@@ -42,7 +42,10 @@ public sealed class MovieId : EntityId<Guid>
|
||||
return new MovieId(value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
|
||||
+4
-1
@@ -116,7 +116,10 @@ public class VideoMetadata : BaseMetadata
|
||||
language, originalLanguage, frameRate, videoCodec, audioCodec, genres, tags);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
foreach (object component in base.GetEqualityComponents())
|
||||
|
||||
+4
-1
@@ -40,7 +40,10 @@ public sealed class EpisodeId : EntityId<Guid>
|
||||
return new EpisodeId(value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
|
||||
+5
-2
@@ -40,9 +40,12 @@ public sealed class SeasonId : EntityId<Guid>
|
||||
return new SeasonId(value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
-2
@@ -40,9 +40,12 @@ public sealed class TvShowId : EntityId<Guid>
|
||||
return new TvShowId(value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -40,7 +40,10 @@ public sealed class BookId : EntityId<Guid>
|
||||
return new BookId(value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
|
||||
+4
-1
@@ -43,7 +43,10 @@ public sealed class BookLibraryId : EntityId<Guid> // TODO: to be removed
|
||||
return new BookLibraryId(value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
|
||||
+4
-1
@@ -52,7 +52,10 @@ public class BookRating : Rating
|
||||
return new BookRating(value, maxValue, source, voteCount);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
|
||||
+5
-2
@@ -43,9 +43,12 @@ public sealed class BookSeriesId : ValueObject
|
||||
return new BookSeriesId(value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -109,7 +109,10 @@ public sealed class Isbn : ValueObject
|
||||
return checkDigit == (isbn[12] - '0');
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
|
||||
+4
-1
@@ -94,7 +94,10 @@ public class WrittenContentMetadata : BaseMetadata
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
foreach (object component in base.GetEqualityComponents())
|
||||
|
||||
+4
-1
@@ -40,7 +40,10 @@ public sealed class LibraryId : EntityId<Guid>
|
||||
return new LibraryId(value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the list of items that define equality of the object.
|
||||
/// </summary>
|
||||
/// <returns>A list of items defining the equality.</returns>
|
||||
public override IEnumerable<object> GetEqualityComponents()
|
||||
{
|
||||
yield return Value;
|
||||
|
||||
+7
-1
@@ -60,7 +60,13 @@ internal sealed class BooksFileSystemDiscoveryJob : MediaLibraryScanJob, IBooksF
|
||||
_serviceScopeFactory = serviceScopeFactory;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Executes the payload of the media library scan job.
|
||||
/// </summary>
|
||||
/// <typeparam name="TInput">The type of the input parameter representing the data to be processed by this payload.</typeparam>
|
||||
/// <param name="id">The id of the media library scan job.</param>
|
||||
/// <param name="input">The input data to be processed by this payload.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
public override async Task ExecuteAsync<TInput>(Guid id, TInput input, CancellationToken cancellationToken)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -42,7 +42,11 @@ internal sealed class PluginDetectionSyncJob : BackgroundService
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// This method is called when the <see cref="IHostedService"/> starts. The implementation should return a task that represents the lifetime of the long running operation(s) being performed.
|
||||
/// </summary>
|
||||
/// <param name="stoppingToken">Triggered when <see cref="IHostedService.StopAsync(CancellationToken)"/> is called.</param>
|
||||
/// <returns>A <see cref="Task"/> that represents the long running operations.</returns>
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
foreach (string loadError in _loadErrors)
|
||||
|
||||
@@ -23,7 +23,11 @@ internal sealed class PluginLoadContext : AssemblyLoadContext
|
||||
_pluginDirectory = pluginDirectory;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Loads the assembly whose assembly name is specified.
|
||||
/// </summary>
|
||||
/// <param name="assemblyName">The object that describes the assembly to be loaded.</param>
|
||||
/// <returns>The loaded assembly, or <see langword="null"/> when it cannot be resolved.</returns>
|
||||
protected override Assembly? Load(AssemblyName assemblyName)
|
||||
{
|
||||
if (assemblyName.Name is null)
|
||||
|
||||
@@ -24,13 +24,20 @@ internal sealed class PluginManager : IPluginManager
|
||||
_pluginsById = plugins.ToDictionary(plugin => plugin.Id);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the plugins that were loaded successfully.
|
||||
/// </summary>
|
||||
/// <returns>The collection of loaded plugins.</returns>
|
||||
public IReadOnlyList<IPlugin> GetPlugins()
|
||||
{
|
||||
return [.. _pluginsById.Values];
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the plugin identified by <paramref name="pluginId"/>.
|
||||
/// </summary>
|
||||
/// <param name="pluginId">The unique identifier of the plugin.</param>
|
||||
/// <returns>The plugin, or <see langword="null"/> when no plugin with the provided Id was loaded.</returns>
|
||||
public IPlugin? GetPlugin(Guid pluginId)
|
||||
{
|
||||
return _pluginsById.GetValueOrDefault(pluginId);
|
||||
|
||||
@@ -33,7 +33,12 @@ internal sealed class PluginSettingsStore : IPluginSettingsStore
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the settings persisted by the host for the plugin identified by <paramref name="pluginId"/>.
|
||||
/// </summary>
|
||||
/// <param name="pluginId">The unique identifier of the plugin whose settings are read.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to cancel the operation.</param>
|
||||
/// <returns>The persisted settings keyed by setting key, or <see langword="null"/> when no settings were persisted for the plugin.</returns>
|
||||
public async Task<IReadOnlyDictionary<string, string>?> GetSettingsAsync(Guid pluginId, CancellationToken cancellationToken)
|
||||
{
|
||||
Result<PluginEntity?> getPluginResult = await _unitOfWork.PluginRepository.GetByIdAsync(pluginId, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -32,13 +32,23 @@ public interface IRemoteMetadataProvider<TLookup, TMetadata> : IRemoteMetadataPr
|
||||
/// <returns>The metadata of the media item, or <see langword="null"/> when no metadata was found.</returns>
|
||||
Task<TMetadata?> GetMetadataAsync(TLookup lookup, CancellationToken cancellationToken);
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Searches for the metadata of the media item described by <paramref name="lookup"/>.
|
||||
/// </summary>
|
||||
/// <param name="lookup">The lookup describing the media item to search for.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>The collection of metadata candidates found for the media item.</returns>
|
||||
async Task<IReadOnlyList<MetadataDto>> IRemoteMetadataProvider.GetSearchResultsAsync(MetadataLookupDto lookup, CancellationToken cancellationToken)
|
||||
{
|
||||
return await GetSearchResultsAsync((TLookup)lookup, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the metadata of the media item described by <paramref name="lookup"/>.
|
||||
/// </summary>
|
||||
/// <param name="lookup">The lookup describing the media item to get the metadata for.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>The metadata of the media item, or <see langword="null"/> when no metadata was found.</returns>
|
||||
async Task<MetadataDto?> IRemoteMetadataProvider.GetMetadataAsync(MetadataLookupDto lookup, CancellationToken cancellationToken)
|
||||
{
|
||||
return await GetMetadataAsync((TLookup)lookup, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
+3
-1
@@ -13,7 +13,9 @@ namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public sealed class SkipWhenHiddenAttributeNotSupportedFactAttribute : FactAttribute
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the reason to skip the test. If set, the test will be skipped instead of executed.
|
||||
/// </summary>
|
||||
public override string Skip => FileSystemStructureFixture.HiddenAttributeIsSupported
|
||||
? string.Empty
|
||||
: "The file system does not support the hidden file attribute, so the hidden elements scenario cannot be set up.";
|
||||
|
||||
+41
-11
@@ -20,28 +20,45 @@ namespace Lumina.Plugins.Contracts.UnitTests.Fakes;
|
||||
/// </summary>
|
||||
public sealed class FakeBookMetadataProvider : IPlugin, IPluginServiceRegistrator, IRemoteMetadataProvider<BookMetadataLookupDto, BookMetadataDto>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the stable unique identifier of the plugin, used to persist its state.
|
||||
/// </summary>
|
||||
public Guid Id { get; } = Guid.Parse("11111111-1111-1111-1111-111111111111");
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the display name of the plugin.
|
||||
/// </summary>
|
||||
public string Name { get; } = "Fake Book Metadata Provider";
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the author of the plugin.
|
||||
/// </summary>
|
||||
public string Author { get; } = "Lumina";
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the version of the plugin.
|
||||
/// </summary>
|
||||
public Version Version { get; } = new(1, 0, 0);
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the description of the plugin.
|
||||
/// </summary>
|
||||
public string Description { get; } = "A fake metadata provider used to exercise the plugin contracts.";
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the media library type this metadata provider supports.
|
||||
/// </summary>
|
||||
public LibraryType SupportedLibraryType { get; } = LibraryType.Book;
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this metadata provider requires access to the web to retrieve metadata.
|
||||
/// </summary>
|
||||
public bool RequiresWebAccess { get; } = true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the settings schema of the plugin, used by the host to render the plugin settings page.
|
||||
/// </summary>
|
||||
/// <returns>The collection of setting descriptors declared by the plugin.</returns>
|
||||
public IReadOnlyList<PluginSettingDescriptor> GetSettingsSchema()
|
||||
{
|
||||
return
|
||||
@@ -62,12 +79,20 @@ public sealed class FakeBookMetadataProvider : IPlugin, IPluginServiceRegistrato
|
||||
];
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Registers the services of the plugin into the host dependency injection container.
|
||||
/// </summary>
|
||||
/// <param name="services">The service collection to which the plugin services are added.</param>
|
||||
public void RegisterServices(IServiceCollection services)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Searches for the metadata of the media item described by <paramref name="lookup"/>.
|
||||
/// </summary>
|
||||
/// <param name="lookup">The lookup describing the media item to search for.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>The collection of metadata candidates found for the media item.</returns>
|
||||
public Task<IReadOnlyList<BookMetadataDto>> GetSearchResultsAsync(BookMetadataLookupDto lookup, CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.FromResult<IReadOnlyList<BookMetadataDto>>(
|
||||
@@ -77,7 +102,12 @@ public sealed class FakeBookMetadataProvider : IPlugin, IPluginServiceRegistrato
|
||||
);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
/// <summary>
|
||||
/// Gets the metadata of the media item described by <paramref name="lookup"/>.
|
||||
/// </summary>
|
||||
/// <param name="lookup">The lookup describing the media item to get the metadata for.</param>
|
||||
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
|
||||
/// <returns>The metadata of the media item, or <see langword="null"/> when no metadata was found.</returns>
|
||||
public Task<BookMetadataDto?> GetMetadataAsync(BookMetadataLookupDto lookup, CancellationToken cancellationToken)
|
||||
{
|
||||
if (lookup.Title is null)
|
||||
|
||||
Reference in new issue
Block a user