Merge pull request #146 from BinaryAlley/refactor/replace-inheritdoc-with-explicit-documentation

Replaces inheritdoc with explicit documentation
This commit is contained in:
BinaryAlley authored and GitHub committed 2026-08-14 10:19:41 -07:00
commit dfc513da4f
40 files changed
+243 -61

No files matched your search

@@ -38,31 +38,52 @@ public struct HashedFileSystemFileDto : IEquatable<HashedFileSystemFileDto>
/// </summary> /// </summary>
public long Ticks { get; set; } 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) public readonly bool Equals(HashedFileSystemFileDto other)
{ {
return Size == other.Size && CurrentHash == other.CurrentHash && OldHash == other.OldHash && Ticks == other.Ticks && Path == other.Path; 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) public override readonly bool Equals(object? obj)
{ {
return obj is HashedFileSystemFileDto item && Equals(item); 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) public static bool operator ==(HashedFileSystemFileDto left, HashedFileSystemFileDto right)
{ {
return left.Equals(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) public static bool operator !=(HashedFileSystemFileDto left, HashedFileSystemFileDto right)
{ {
return !(left == 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() public override readonly int GetHashCode()
{ {
return HashCode.Combine(Size, CurrentHash, OldHash, Ticks, Path); return HashCode.Combine(Size, CurrentHash, OldHash, Ticks, Path);
@@ -89,7 +89,10 @@ public abstract class BaseMetadata : ValueObject
OriginalLanguage = originalLanguage; 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Title; yield return Title;
@@ -41,7 +41,10 @@ public class Genre : ValueObject
return new Genre(name); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Name; yield return Name;
@@ -63,7 +63,10 @@ public class LanguageInfo : ValueObject
return new LanguageInfo(languageCode, languageName, nativeName); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return LanguageCode; yield return LanguageCode;
@@ -101,7 +101,10 @@ public class ReleaseInfo : ValueObject
return new ReleaseInfo(originalReleaseDate, originalReleaseYear, reReleaseDate, reReleaseYear, releaseCountry, releaseVersion); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return OriginalReleaseDate; yield return OriginalReleaseDate;
@@ -42,7 +42,10 @@ public class Tag : ValueObject
return new Tag(name); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Name; yield return Name;
@@ -138,7 +138,10 @@ public class AudioMetadata : BaseMetadata
bitrate); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
foreach (object component in base.GetEqualityComponents()) foreach (object component in base.GetEqualityComponents())
@@ -28,7 +28,10 @@ public sealed class FileSystemPathId : ValueObject
Path = path; 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Path; yield return Path;
@@ -58,7 +58,10 @@ public class PathSegment : ValueObject
return new PathSegment(name, isDirectory, isDrive); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Name; yield return Name;
@@ -119,7 +119,10 @@ public class StreamInfo : ValueObject
return new StreamInfo(streamId, mimeType, bitrate, codec, resolution, frameRate, sampleRate, channels); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return StreamId; yield return StreamId;
@@ -34,7 +34,10 @@ public class Thumbnail : ValueObject
Bytes = bytes; 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Type; yield return Type;
@@ -40,7 +40,10 @@ public sealed class LibraryId : EntityId<Guid>
return new LibraryId(value); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
@@ -45,7 +45,10 @@ public sealed class MediaLibraryScanCompositeId : ValueObject
return new MediaLibraryScanCompositeId(scanId, userId); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return ScanId; yield return ScanId;
@@ -69,7 +69,10 @@ public sealed class MediaLibraryScanJobProgress : ValueObject
return new MediaLibraryScanJobProgress(completedItems, totalItems, currentOperation); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return CompletedItems; yield return CompletedItems;
@@ -117,7 +117,10 @@ public sealed class MediaLibraryScanProgress : ValueObject
return new MediaLibraryScanProgress(scanId, userId, libraryId, completedJobs, totalJobs, status, currentJobProgress); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return CompletedJobs; yield return CompletedJobs;
@@ -40,7 +40,10 @@ public sealed class ScanId : EntityId<Guid>
return new ScanId(value); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
@@ -46,7 +46,10 @@ public sealed class MediaContributorName : ValueObject
return new MediaContributorName(displayName, legalName); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return DisplayName; yield return DisplayName;
@@ -40,9 +40,12 @@ public sealed class MediaContributorId : EntityId<Guid>
return new MediaContributorId(value); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
} }
} }
@@ -45,10 +45,13 @@ public sealed class MediaContributorRole : ValueObject
return new MediaContributorRole(name, category); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Name; yield return Name;
yield return Category; yield return Category;
} }
} }
@@ -40,7 +40,10 @@ public sealed class UserId : EntityId<Guid>
return new UserId(value); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
@@ -42,7 +42,10 @@ public sealed class MovieId : EntityId<Guid>
return new MovieId(value); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
@@ -116,7 +116,10 @@ public class VideoMetadata : BaseMetadata
language, originalLanguage, frameRate, videoCodec, audioCodec, genres, tags); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
foreach (object component in base.GetEqualityComponents()) foreach (object component in base.GetEqualityComponents())
@@ -40,7 +40,10 @@ public sealed class EpisodeId : EntityId<Guid>
return new EpisodeId(value); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
@@ -40,9 +40,12 @@ public sealed class SeasonId : EntityId<Guid>
return new SeasonId(value); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
} }
} }
@@ -40,9 +40,12 @@ public sealed class TvShowId : EntityId<Guid>
return new TvShowId(value); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
} }
} }
@@ -40,7 +40,10 @@ public sealed class BookId : EntityId<Guid>
return new BookId(value); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
@@ -43,7 +43,10 @@ public sealed class BookLibraryId : EntityId<Guid> // TODO: to be removed
return new BookLibraryId(value); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
@@ -52,7 +52,10 @@ public class BookRating : Rating
return new BookRating(value, maxValue, source, voteCount); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
@@ -43,9 +43,12 @@ public sealed class BookSeriesId : ValueObject
return new BookSeriesId(value); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
} }
} }
@@ -109,7 +109,10 @@ public sealed class Isbn : ValueObject
return checkDigit == (isbn[12] - '0'); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
@@ -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() public override IEnumerable<object> GetEqualityComponents()
{ {
foreach (object component in base.GetEqualityComponents()) foreach (object component in base.GetEqualityComponents())
@@ -40,7 +40,10 @@ public sealed class LibraryId : EntityId<Guid>
return new LibraryId(value); 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() public override IEnumerable<object> GetEqualityComponents()
{ {
yield return Value; yield return Value;
@@ -60,7 +60,13 @@ internal sealed class BooksFileSystemDiscoveryJob : MediaLibraryScanJob, IBooksF
_serviceScopeFactory = serviceScopeFactory; _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) public override async Task ExecuteAsync<TInput>(Guid id, TInput input, CancellationToken cancellationToken)
{ {
try try
@@ -42,7 +42,11 @@ internal sealed class PluginDetectionSyncJob : BackgroundService
_logger = logger; _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) protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{ {
foreach (string loadError in _loadErrors) foreach (string loadError in _loadErrors)
@@ -23,7 +23,11 @@ internal sealed class PluginLoadContext : AssemblyLoadContext
_pluginDirectory = pluginDirectory; _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) protected override Assembly? Load(AssemblyName assemblyName)
{ {
if (assemblyName.Name is null) if (assemblyName.Name is null)
@@ -24,13 +24,20 @@ internal sealed class PluginManager : IPluginManager
_pluginsById = plugins.ToDictionary(plugin => plugin.Id); _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() public IReadOnlyList<IPlugin> GetPlugins()
{ {
return [.. _pluginsById.Values]; 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) public IPlugin? GetPlugin(Guid pluginId)
{ {
return _pluginsById.GetValueOrDefault(pluginId); return _pluginsById.GetValueOrDefault(pluginId);
@@ -33,7 +33,12 @@ internal sealed class PluginSettingsStore : IPluginSettingsStore
_logger = logger; _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) public async Task<IReadOnlyDictionary<string, string>?> GetSettingsAsync(Guid pluginId, CancellationToken cancellationToken)
{ {
Result<PluginEntity?> getPluginResult = await _unitOfWork.PluginRepository.GetByIdAsync(pluginId, cancellationToken).ConfigureAwait(false); 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> /// <returns>The metadata of the media item, or <see langword="null"/> when no metadata was found.</returns>
Task<TMetadata?> GetMetadataAsync(TLookup lookup, CancellationToken cancellationToken); 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) async Task<IReadOnlyList<MetadataDto>> IRemoteMetadataProvider.GetSearchResultsAsync(MetadataLookupDto lookup, CancellationToken cancellationToken)
{ {
return await GetSearchResultsAsync((TLookup)lookup, cancellationToken).ConfigureAwait(false); 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) async Task<MetadataDto?> IRemoteMetadataProvider.GetMetadataAsync(MetadataLookupDto lookup, CancellationToken cancellationToken)
{ {
return await GetMetadataAsync((TLookup)lookup, cancellationToken).ConfigureAwait(false); return await GetMetadataAsync((TLookup)lookup, cancellationToken).ConfigureAwait(false);
@@ -13,7 +13,9 @@ namespace Lumina.Presentation.Api.IntegrationTests.Common.Setup;
[AttributeUsage(AttributeTargets.Method)] [AttributeUsage(AttributeTargets.Method)]
public sealed class SkipWhenHiddenAttributeNotSupportedFactAttribute : FactAttribute 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 public override string Skip => FileSystemStructureFixture.HiddenAttributeIsSupported
? string.Empty ? string.Empty
: "The file system does not support the hidden file attribute, so the hidden elements scenario cannot be set up."; : "The file system does not support the hidden file attribute, so the hidden elements scenario cannot be set up.";
@@ -20,28 +20,45 @@ namespace Lumina.Plugins.Contracts.UnitTests.Fakes;
/// </summary> /// </summary>
public sealed class FakeBookMetadataProvider : IPlugin, IPluginServiceRegistrator, IRemoteMetadataProvider<BookMetadataLookupDto, BookMetadataDto> 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"); 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"; public string Name { get; } = "Fake Book Metadata Provider";
/// <inheritdoc/> /// <summary>
/// Gets the author of the plugin.
/// </summary>
public string Author { get; } = "Lumina"; public string Author { get; } = "Lumina";
/// <inheritdoc/> /// <summary>
/// Gets the version of the plugin.
/// </summary>
public Version Version { get; } = new(1, 0, 0); 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."; 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; 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; 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() public IReadOnlyList<PluginSettingDescriptor> GetSettingsSchema()
{ {
return 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) 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) public Task<IReadOnlyList<BookMetadataDto>> GetSearchResultsAsync(BookMetadataLookupDto lookup, CancellationToken cancellationToken)
{ {
return Task.FromResult<IReadOnlyList<BookMetadataDto>>( 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) public Task<BookMetadataDto?> GetMetadataAsync(BookMetadataLookupDto lookup, CancellationToken cancellationToken)
{ {
if (lookup.Title is null) if (lookup.Title is null)