Apply review suggestions

This commit is contained in:
Shadowghost 2022-04-27 13:08:54 +02:00
parent 4b1654ae3b
commit 2e639c77c7
8 changed files with 62 additions and 55 deletions

View File

@ -387,7 +387,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
if (!string.IsNullOrEmpty(item.Path))
{
// Check for IMDb id - we use full media path, as we can assume that this will match in any use case (wither id in parent dir or in file name)
// Check for IMDb id - we use full media path, as we can assume that this will match in any use case (whether id in parent dir or in file name)
var imdbid = item.Path.AsSpan().GetAttributeValue("imdbid");
if (!string.IsNullOrWhiteSpace(imdbid))

View File

@ -25,7 +25,7 @@ namespace MediaBrowser.Controller.Providers
/// </summary>
/// <param name="info">The LookupInfoType to get metadata for.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>Task{MetadataResult{TItemType}}.</returns>
/// <returns>A task returning a MetadataResult for the specific LookupInfoType.</returns>
Task<MetadataResult<TItemType>> GetMetadata(TLookupInfoType info, CancellationToken cancellationToken);
}
@ -40,7 +40,7 @@ namespace MediaBrowser.Controller.Providers
/// </summary>
/// <param name="searchInfo">The LookupInfoType to search for.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>Task{IEnumerable{RemoteSearchResult}}.</returns>
/// <returns>A task returning RemoteSearchResults for the searchInfo.</returns>
Task<IEnumerable<RemoteSearchResult>> GetSearchResults(TLookupInfoType searchInfo, CancellationToken cancellationToken);
}
}

View File

@ -12,77 +12,77 @@ namespace MediaBrowser.Model.Entities
Custom = 0,
/// <summary>
/// The IMDb id.
/// The IMDb provider.
/// </summary>
Imdb = 2,
/// <summary>
/// The TMDb id.
/// The TMDb provider.
/// </summary>
Tmdb = 3,
/// <summary>
/// The TVDb id.
/// The TVDb provider.
/// </summary>
Tvdb = 4,
/// <summary>
/// The tvcom id.
/// The tvcom providerd.
/// </summary>
Tvcom = 5,
/// <summary>
/// TMDb collection id.
/// TMDb collection provider.
/// </summary>
TmdbCollection = 7,
/// <summary>
/// The MusicBrainz album id.
/// The MusicBrainz album provider.
/// </summary>
MusicBrainzAlbum = 8,
/// <summary>
/// The MusicBrainz album artist id.
/// The MusicBrainz album artist provider.
/// </summary>
MusicBrainzAlbumArtist = 9,
/// <summary>
/// The MusicBrainz artist id.
/// The MusicBrainz artist provider.
/// </summary>
MusicBrainzArtist = 10,
/// <summary>
/// The MusicBrainz release group id.
/// The MusicBrainz release group provider.
/// </summary>
MusicBrainzReleaseGroup = 11,
/// <summary>
/// The Zap2It id.
/// The Zap2It provider.
/// </summary>
Zap2It = 12,
/// <summary>
/// The TvRage id.
/// The TvRage provider.
/// </summary>
TvRage = 15,
/// <summary>
/// The AudioDb artist id.
/// The AudioDb artist provider.
/// </summary>
AudioDbArtist = 16,
/// <summary>
/// The AudioDb collection id.
/// The AudioDb collection provider.
/// </summary>
AudioDbAlbum = 17,
/// <summary>
/// The MusicBrainz track id.
/// The MusicBrainz track provider.
/// </summary>
MusicBrainzTrack = 18,
/// <summary>
/// The TvMaze id.
/// The TvMaze provider.
/// </summary>
TvMaze = 19
}

View File

@ -50,10 +50,7 @@ namespace MediaBrowser.Providers.Plugins.StudioImages
/// <inheritdoc/>
public override string ConfigurationFileName => "Jellyfin.Plugin.StudioImages.xml";
/// <summary>
/// Return the plugin configuration page.
/// </summary>
/// <returns>PluginPageInfo.</returns>
/// <inheritdoc/>
public IEnumerable<PluginPageInfo> GetPages()
{
yield return new PluginPageInfo

View File

@ -122,13 +122,13 @@ namespace MediaBrowser.Providers.Plugins.StudioImages
}
/// <summary>
/// Ensures the list.
/// Ensures the existence of a file listing.
/// </summary>
/// <param name="url">The URL.</param>
/// <param name="file">The file.</param>
/// <param name="fileSystem">The file system.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
/// <returns>A Task to ensure existence of a file listing.</returns>
public async Task<string> EnsureList(string url, string file, IFileSystem fileSystem, CancellationToken cancellationToken)
{
var fileInfo = fileSystem.GetFileInfo(file);
@ -151,7 +151,7 @@ namespace MediaBrowser.Providers.Plugins.StudioImages
/// </summary>
/// <param name="item">The <see cref="BaseItem"/>.</param>
/// <param name="images">The enumerable of image strings.</param>
/// <returns>String.</returns>
/// <returns>The matching image string.</returns>
public string FindMatch(BaseItem item, IEnumerable<string> images)
{
var name = GetComparableName(item.Name);
@ -170,10 +170,10 @@ namespace MediaBrowser.Providers.Plugins.StudioImages
}
/// <summary>
/// Get available images for a file.
/// Get available image strings for a file.
/// </summary>
/// <param name="file">The file.</param>
/// <returns>IEnumerable{string}.</returns>
/// <returns>All images strings of a file.</returns>
public IEnumerable<string> GetAvailableImages(string file)
{
using var fileStream = File.OpenRead(file);

View File

@ -16,7 +16,7 @@ using MediaBrowser.Model.Providers;
namespace MediaBrowser.Providers.Plugins.Tmdb.TV
{
/// <summary>
/// TV episode iage provider powered by TheMovieDb.
/// TV episode image provider powered by TheMovieDb.
/// </summary>
public class TmdbEpisodeImageProvider : IRemoteImageProvider, IHasOrder
{

View File

@ -27,21 +27,16 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
/// </summary>
/// <param name="httpClientFactory">The <see cref="IHttpClientFactory"/>.</param>
/// <param name="tmdbClientManager">The <see cref="TmdbClientManager"/>.</param>
public TmdbSeasonImageProvider(IHttpClientFactory httpClientFactory, TmdbClientManager tmdbClientManager)
{
_httpClientFactory = httpClientFactory;
_tmdbClientManager = tmdbClientManager;
}
/// <summary>
/// The order.
/// </summary>
/// <inheritdoc/>
public int Order => 1;
/// <summary>
/// The name.
/// </summary>
/// <inheritdoc/>
public string Name => TmdbUtils.ProviderName;
/// <inheritdoc />

View File

@ -1,5 +1,3 @@
#pragma warning disable CS1591
using System;
using System.Collections.Generic;
using System.Globalization;
@ -23,6 +21,10 @@ using Microsoft.Extensions.Logging;
namespace MediaBrowser.XbmcMetadata.Parsers
{
/// <summary>
/// The BaseNfoParser class.
/// </summary>
/// <typeparam name="T">The type.</typeparam>
public class BaseNfoParser<T>
where T : BaseItem
{
@ -63,16 +65,22 @@ namespace MediaBrowser.XbmcMetadata.Parsers
/// </summary>
protected ILogger Logger { get; }
/// <summary>
/// Gets the provider manager.
/// </summary>
protected IProviderManager ProviderManager { get; }
/// <summary>
/// Gets a value indicating whether URLs after a closing XML tag are supporrted.
/// </summary>
protected virtual bool SupportsUrlAfterClosingXmlTag => false;
/// <summary>
/// Fetches metadata for an item from one xml file.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="item">The <see cref="MetadataResult{T}"/>.</param>
/// <param name="metadataFile">The metadata file.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <exception cref="ArgumentNullException"><c>item</c> is <c>null</c>.</exception>
/// <exception cref="ArgumentException"><c>metadataFile</c> is <c>null</c> or empty.</exception>
public void Fetch(MetadataResult<T> item, string metadataFile, CancellationToken cancellationToken)
@ -111,10 +119,10 @@ namespace MediaBrowser.XbmcMetadata.Parsers
/// <summary>
/// Fetches the specified item.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="item">The <see cref="MetadataResult{T}"/>.</param>
/// <param name="metadataFile">The metadata file.</param>
/// <param name="settings">The settings.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="settings">The <see cref="XmlReaderSettings"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
protected virtual void Fetch(MetadataResult<T> item, string metadataFile, XmlReaderSettings settings, CancellationToken cancellationToken)
{
if (!SupportsUrlAfterClosingXmlTag)
@ -216,6 +224,11 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
}
/// <summary>
/// Parses a XML tag to a provider id.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="xml">The xml tag.</param>
protected void ParseProviderLinks(T item, ReadOnlySpan<char> xml)
{
if (ProviderIdParsers.TryFindImdbId(xml, out var imdbId))
@ -245,6 +258,11 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
}
/// <summary>
/// Fetches metadata from an XML node.
/// </summary>
/// <param name="reader">The <see cref="XmlReader"/>.</param>
/// <param name="itemResult">The <see cref="MetadataResult{T}"/>.</param>
protected virtual void FetchDataFromXmlNode(XmlReader reader, MetadataResult<T> itemResult)
{
var item = itemResult.Item;
@ -1100,16 +1118,13 @@ namespace MediaBrowser.XbmcMetadata.Parsers
switch (reader.Name)
{
case "language":
{
_ = reader.ReadElementContentAsString();
if (item is Video video)
{
video.HasSubtitles = true;
}
break;
}
default:
reader.Skip();
@ -1210,9 +1225,9 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
/// <summary>
/// Gets the persons from XML node.
/// Gets the persons from a XML node.
/// </summary>
/// <param name="reader">The reader.</param>
/// <param name="reader">The <see cref="XmlReader"/>.</param>
/// <returns>IEnumerable{PersonInfo}.</returns>
private PersonInfo GetPersonFromXmlNode(XmlReader reader)
{
@ -1348,10 +1363,10 @@ namespace MediaBrowser.XbmcMetadata.Parsers
}
/// <summary>
/// Parses the ImageType from the nfo aspect property.
/// Parses the <see cref="ImageType"/> from the NFO aspect property.
/// </summary>
/// <param name="aspect">The nfo aspect property.</param>
/// <returns>The image type.</returns>
/// <param name="aspect">The NFO aspect property.</param>
/// <returns>The <see cref="ImageType"/>.</returns>
private static ImageType GetImageType(string aspect)
{
return aspect switch