aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs')
-rw-r--r--MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs31
1 files changed, 27 insertions, 4 deletions
diff --git a/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs b/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs
index ef822a22a..ffbb338e8 100644
--- a/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs
+++ b/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs
@@ -1,7 +1,5 @@
#nullable disable
-#pragma warning disable CS1591
-
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -21,12 +19,21 @@ using MediaBrowser.Model.Providers;
namespace MediaBrowser.Providers.Plugins.StudioImages
{
+ /// <summary>
+ /// Studio image provider.
+ /// </summary>
public class StudiosImageProvider : IRemoteImageProvider
{
private readonly IServerConfigurationManager _config;
private readonly IHttpClientFactory _httpClientFactory;
private readonly IFileSystem _fileSystem;
+ /// <summary>
+ /// Initializes a new instance of the <see cref="StudiosImageProvider"/> class.
+ /// </summary>
+ /// <param name="config">The <see cref="IServerConfigurationManager"/>.</param>
+ /// <param name="httpClientFactory">The <see cref="IHttpClientFactory"/>.</param>
+ /// <param name="fileSystem">The <see cref="IFileSystem"/>.</param>
public StudiosImageProvider(IServerConfigurationManager config, IHttpClientFactory httpClientFactory, IFileSystem fileSystem)
{
_config = config;
@@ -34,13 +41,16 @@ namespace MediaBrowser.Providers.Plugins.StudioImages
_fileSystem = fileSystem;
}
+ /// <inheritdoc />
public string Name => "Artwork Repository";
+ /// <inheritdoc />
public bool Supports(BaseItem item)
{
return item is Studio;
}
+ /// <inheritdoc />
public IEnumerable<ImageType> GetSupportedImages(BaseItem item)
{
return new List<ImageType>
@@ -49,6 +59,7 @@ namespace MediaBrowser.Providers.Plugins.StudioImages
};
}
+ /// <inheritdoc />
public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken)
{
var thumbsPath = Path.Combine(_config.ApplicationPaths.CachePath, "imagesbyname", "remotestudiothumbs.txt");
@@ -103,6 +114,7 @@ namespace MediaBrowser.Providers.Plugins.StudioImages
return EnsureList(url, file, _fileSystem, cancellationToken);
}
+ /// <inheritdoc />
public Task<HttpResponseMessage> GetImageResponse(string url, CancellationToken cancellationToken)
{
var httpClient = _httpClientFactory.CreateClient(NamedClient.Default);
@@ -110,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);
@@ -134,6 +146,12 @@ namespace MediaBrowser.Providers.Plugins.StudioImages
return file;
}
+ /// <summary>
+ /// Get matching image for an item.
+ /// </summary>
+ /// <param name="item">The <see cref="BaseItem"/>.</param>
+ /// <param name="images">The enumerable of image strings.</param>
+ /// <returns>The matching image string.</returns>
public string FindMatch(BaseItem item, IEnumerable<string> images)
{
var name = GetComparableName(item.Name);
@@ -151,6 +169,11 @@ namespace MediaBrowser.Providers.Plugins.StudioImages
.Replace("/", string.Empty, StringComparison.Ordinal);
}
+ /// <summary>
+ /// Get available image strings for a file.
+ /// </summary>
+ /// <param name="file">The file.</param>
+ /// <returns>All images strings of a file.</returns>
public IEnumerable<string> GetAvailableImages(string file)
{
using var fileStream = File.OpenRead(file);