aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Thornton <thornbill@users.noreply.github.com>2022-03-08 10:36:05 -0500
committerGitHub <noreply@github.com>2022-03-08 16:36:05 +0100
commitc5ca29d2e2bb2db43a3dbf5ae42c1d2a64c857d6 (patch)
treecc61e7048df48eca3b2ce08ddc08e724d4a85cf4
parent03f1eff21abf75d88d15df05b6a841e48943c7ef (diff)
Remove unused poster support from StudiosImageProvider (#7423)
-rw-r--r--MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs41
1 files changed, 11 insertions, 30 deletions
diff --git a/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs b/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs
index e81324a6b..ce267ac84 100644
--- a/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs
+++ b/MediaBrowser.Providers/Plugins/StudioImages/StudiosImageProvider.cs
@@ -50,41 +50,29 @@ namespace MediaBrowser.Providers.Studios
{
return new List<ImageType>
{
- ImageType.Primary,
ImageType.Thumb
};
}
- public Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken)
+ public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken)
{
- return GetImages(item, true, true, cancellationToken);
- }
-
- private async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, bool posters, bool thumbs, CancellationToken cancellationToken)
- {
- var list = new List<RemoteImageInfo>();
-
- if (posters)
- {
- var posterPath = Path.Combine(_config.ApplicationPaths.CachePath, "imagesbyname", "remotestudioposters.txt");
+ var thumbsPath = Path.Combine(_config.ApplicationPaths.CachePath, "imagesbyname", "remotestudiothumbs.txt");
- posterPath = await EnsurePosterList(posterPath, cancellationToken).ConfigureAwait(false);
-
- list.Add(GetImage(item, posterPath, ImageType.Primary, "folder"));
- }
+ thumbsPath = await EnsureThumbsList(thumbsPath, cancellationToken).ConfigureAwait(false);
cancellationToken.ThrowIfCancellationRequested();
- if (thumbs)
- {
- var thumbsPath = Path.Combine(_config.ApplicationPaths.CachePath, "imagesbyname", "remotestudiothumbs.txt");
-
- thumbsPath = await EnsureThumbsList(thumbsPath, cancellationToken).ConfigureAwait(false);
+ var imageInfo = GetImage(item, thumbsPath, ImageType.Thumb, "thumb");
- list.Add(GetImage(item, thumbsPath, ImageType.Thumb, "thumb"));
+ if (imageInfo == null)
+ {
+ return Enumerable.Empty<RemoteImageInfo>();
}
- return list.Where(i => i != null);
+ return new RemoteImageInfo[]
+ {
+ imageInfo
+ };
}
private RemoteImageInfo GetImage(BaseItem item, string filename, ImageType type, string remoteFilename)
@@ -120,13 +108,6 @@ namespace MediaBrowser.Providers.Studios
return EnsureList(url, file, _fileSystem, cancellationToken);
}
- private Task<string> EnsurePosterList(string file, CancellationToken cancellationToken)
- {
- string url = string.Format(CultureInfo.InvariantCulture, "{0}/posters.txt", repositoryUrl);
-
- return EnsureList(url, file, _fileSystem, cancellationToken);
- }
-
public Task<HttpResponseMessage> GetImageResponse(string url, CancellationToken cancellationToken)
{
var httpClient = _httpClientFactory.CreateClient(NamedClient.Default);