From b934b346e1f2a78ece62e0248f55fcb6a8e8ff2a Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Wed, 11 Jan 2023 10:36:18 +0100 Subject: Fix all warnings in MediaBrowser.Providers --- .../Plugins/Tmdb/TmdbClientManager.cs | 48 +++++++++------------- 1 file changed, 19 insertions(+), 29 deletions(-) (limited to 'MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs') diff --git a/MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs b/MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs index b56c0d7482..c7441bf357 100644 --- a/MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs +++ b/MediaBrowser.Providers/Plugins/Tmdb/TmdbClientManager.cs @@ -531,55 +531,45 @@ namespace MediaBrowser.Providers.Plugins.Tmdb /// /// The input images. /// The requested language. - /// The collection to add the remote images into. - public void ConvertPostersToRemoteImageInfo(List images, string requestLanguage, List results) - { - ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.PosterSize, ImageType.Primary, requestLanguage, results); - } + /// The remote images. + public IEnumerable ConvertPostersToRemoteImageInfo(IReadOnlyList images, string requestLanguage) + => ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.PosterSize, ImageType.Primary, requestLanguage); /// /// Converts backdrop s into s. /// /// The input images. /// The requested language. - /// The collection to add the remote images into. - public void ConvertBackdropsToRemoteImageInfo(List images, string requestLanguage, List results) - { - ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.BackdropSize, ImageType.Backdrop, requestLanguage, results); - } + /// The remote images. + public IEnumerable ConvertBackdropsToRemoteImageInfo(IReadOnlyList images, string requestLanguage) + => ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.BackdropSize, ImageType.Backdrop, requestLanguage); /// /// Converts logo s into s. /// /// The input images. /// The requested language. - /// The collection to add the remote images into. - public void ConvertLogosToRemoteImageInfo(List images, string requestLanguage, List results) - { - ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.LogoSize, ImageType.Logo, requestLanguage, results); - } + /// The remote images. + public IEnumerable ConvertLogosToRemoteImageInfo(IReadOnlyList images, string requestLanguage) + => ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.LogoSize, ImageType.Logo, requestLanguage); /// /// Converts profile s into s. /// /// The input images. /// The requested language. - /// The collection to add the remote images into. - public void ConvertProfilesToRemoteImageInfo(List images, string requestLanguage, List results) - { - ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.ProfileSize, ImageType.Primary, requestLanguage, results); - } + /// The remote images. + public IEnumerable ConvertProfilesToRemoteImageInfo(IReadOnlyList images, string requestLanguage) + => ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.ProfileSize, ImageType.Primary, requestLanguage); /// /// Converts still s into s. /// /// The input images. /// The requested language. - /// The collection to add the remote images into. - public void ConvertStillsToRemoteImageInfo(List images, string requestLanguage, List results) - { - ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.StillSize, ImageType.Primary, requestLanguage, results); - } + /// The remote images. + public IEnumerable ConvertStillsToRemoteImageInfo(IReadOnlyList images, string requestLanguage) + => ConvertToRemoteImageInfo(images, Plugin.Instance.Configuration.StillSize, ImageType.Primary, requestLanguage); /// /// Converts s into s. @@ -588,8 +578,8 @@ namespace MediaBrowser.Providers.Plugins.Tmdb /// The size of the image to fetch. /// The type of the image. /// The requested language. - /// The collection to add the remote images into. - private void ConvertToRemoteImageInfo(List images, string size, ImageType type, string requestLanguage, List results) + /// The remote images. + private IEnumerable ConvertToRemoteImageInfo(IReadOnlyList images, string size, ImageType type, string requestLanguage) { // sizes provided are for original resolution, don't store them when downloading scaled images var scaleImage = !string.Equals(size, "original", StringComparison.OrdinalIgnoreCase); @@ -598,7 +588,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb { var image = images[i]; - results.Add(new RemoteImageInfo + yield return new RemoteImageInfo { Url = GetUrl(size, image.FilePath), CommunityRating = image.VoteAverage, @@ -609,7 +599,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb ProviderName = TmdbUtils.ProviderName, Type = type, RatingType = RatingType.Score - }); + }; } } -- cgit v1.2.3