Remove unused IHasScreenshots interface

pull/6769/head
Bond_009 3 years ago
parent 5c5d49ee60
commit 924c6682b9

@ -1,9 +0,0 @@
namespace MediaBrowser.Controller.Entities
{
/// <summary>
/// The item has screenshots.
/// </summary>
public interface IHasScreenshots
{
}
}

@ -256,11 +256,6 @@ namespace MediaBrowser.LocalMetadata.Images
{ {
PopulateBackdrops(item, images, files, imagePrefix, isInMixedFolder); PopulateBackdrops(item, images, files, imagePrefix, isInMixedFolder);
} }
if (item is IHasScreenshots)
{
PopulateScreenshots(images, files, imagePrefix, isInMixedFolder);
}
} }
private void PopulatePrimaryImages(BaseItem item, List<LocalImageInfo> images, List<FileSystemMetadata> files, string imagePrefix, bool isInMixedFolder) private void PopulatePrimaryImages(BaseItem item, List<LocalImageInfo> images, List<FileSystemMetadata> files, string imagePrefix, bool isInMixedFolder)
@ -363,11 +358,6 @@ namespace MediaBrowser.LocalMetadata.Images
})); }));
} }
private void PopulateScreenshots(List<LocalImageInfo> images, List<FileSystemMetadata> files, string imagePrefix, bool isInMixedFolder)
{
PopulateBackdrops(images, files, imagePrefix, "screenshot", "screenshot", isInMixedFolder, ImageType.Screenshot);
}
private void PopulateBackdrops(List<LocalImageInfo> images, List<FileSystemMetadata> files, string imagePrefix, string firstFileName, string subsequentFileNamePrefix, bool isInMixedFolder, ImageType type) private void PopulateBackdrops(List<LocalImageInfo> images, List<FileSystemMetadata> files, string imagePrefix, string firstFileName, string subsequentFileNamePrefix, bool isInMixedFolder, ImageType type)
{ {
AddImage(files, images, imagePrefix + firstFileName, type); AddImage(files, images, imagePrefix + firstFileName, type);

@ -343,12 +343,6 @@ namespace MediaBrowser.Providers.Manager
minWidth = savedOptions.GetMinWidth(ImageType.Backdrop); minWidth = savedOptions.GetMinWidth(ImageType.Backdrop);
await DownloadMultiImages(item, ImageType.Backdrop, refreshOptions, backdropLimit, provider, result, list, minWidth, cancellationToken).ConfigureAwait(false); await DownloadMultiImages(item, ImageType.Backdrop, refreshOptions, backdropLimit, provider, result, list, minWidth, cancellationToken).ConfigureAwait(false);
if (item is IHasScreenshots)
{
minWidth = savedOptions.GetMinWidth(ImageType.Screenshot);
await DownloadMultiImages(item, ImageType.Screenshot, refreshOptions, screenshotLimit, provider, result, list, minWidth, cancellationToken).ConfigureAwait(false);
}
} }
catch (OperationCanceledException) catch (OperationCanceledException)
{ {
@ -438,11 +432,6 @@ namespace MediaBrowser.Providers.Manager
changed = true; changed = true;
} }
if (item is IHasScreenshots && UpdateMultiImages(item, images, ImageType.Screenshot))
{
changed = true;
}
return changed; return changed;
} }

@ -10,7 +10,6 @@ using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Configuration;
@ -43,7 +42,7 @@ namespace Jellyfin.Providers.Tests.Manager
public void ValidateImages_EmptyItemEmptyProviders_NoChange() public void ValidateImages_EmptyItemEmptyProviders_NoChange()
{ {
var itemImageProvider = GetItemImageProvider(null, null); var itemImageProvider = GetItemImageProvider(null, null);
var changed = itemImageProvider.ValidateImages(new MovieWithScreenshots(), Enumerable.Empty<ILocalImageProvider>(), null); var changed = itemImageProvider.ValidateImages(new Video(), Enumerable.Empty<ILocalImageProvider>(), null);
Assert.False(changed); Assert.False(changed);
} }
@ -55,8 +54,7 @@ namespace Jellyfin.Providers.Tests.Manager
// minimal test cases that hit different handling // minimal test cases that hit different handling
{ ImageType.Primary, 1 }, { ImageType.Primary, 1 },
{ ImageType.Backdrop, 1 }, { ImageType.Backdrop, 1 },
{ ImageType.Backdrop, 2 }, { ImageType.Backdrop, 2 }
{ ImageType.Screenshot, 1 }
}; };
return theoryTypes; return theoryTypes;
@ -69,7 +67,7 @@ namespace Jellyfin.Providers.Tests.Manager
// Has to exist for querying DateModified time on file, results stored but not checked so not populating // Has to exist for querying DateModified time on file, results stored but not checked so not populating
BaseItem.FileSystem = Mock.Of<IFileSystem>(); BaseItem.FileSystem = Mock.Of<IFileSystem>();
var item = new MovieWithScreenshots(); var item = new Video();
var imageProvider = GetImageProvider(imageType, imageCount, true); var imageProvider = GetImageProvider(imageType, imageCount, true);
var itemImageProvider = GetItemImageProvider(null, null); var itemImageProvider = GetItemImageProvider(null, null);
@ -109,7 +107,7 @@ namespace Jellyfin.Providers.Tests.Manager
public void MergeImages_EmptyItemNewImagesEmpty_NoChange() public void MergeImages_EmptyItemNewImagesEmpty_NoChange()
{ {
var itemImageProvider = GetItemImageProvider(null, null); var itemImageProvider = GetItemImageProvider(null, null);
var changed = itemImageProvider.MergeImages(new MovieWithScreenshots(), Array.Empty<LocalImageInfo>()); var changed = itemImageProvider.MergeImages(new Video(), Array.Empty<LocalImageInfo>());
Assert.False(changed); Assert.False(changed);
} }
@ -270,7 +268,7 @@ namespace Jellyfin.Providers.Tests.Manager
// Has to exist for querying DateModified time on file, results stored but not checked so not populating // Has to exist for querying DateModified time on file, results stored but not checked so not populating
BaseItem.FileSystem = Mock.Of<IFileSystem>(); BaseItem.FileSystem = Mock.Of<IFileSystem>();
var item = new MovieWithScreenshots(); var item = new Video();
var libraryOptions = GetLibraryOptions(item, imageType, imageCount); var libraryOptions = GetLibraryOptions(item, imageType, imageCount);
@ -312,11 +310,9 @@ namespace Jellyfin.Providers.Tests.Manager
[InlineData(ImageType.Primary, 1, false)] [InlineData(ImageType.Primary, 1, false)]
[InlineData(ImageType.Backdrop, 1, false)] [InlineData(ImageType.Backdrop, 1, false)]
[InlineData(ImageType.Backdrop, 2, false)] [InlineData(ImageType.Backdrop, 2, false)]
[InlineData(ImageType.Screenshot, 2, false)]
[InlineData(ImageType.Primary, 1, true)] [InlineData(ImageType.Primary, 1, true)]
[InlineData(ImageType.Backdrop, 1, true)] [InlineData(ImageType.Backdrop, 1, true)]
[InlineData(ImageType.Backdrop, 2, true)] [InlineData(ImageType.Backdrop, 2, true)]
[InlineData(ImageType.Screenshot, 2, true)]
public async void RefreshImages_PopulatedItemPopulatedProviderRemote_UpdatesImagesIfForced(ImageType imageType, int imageCount, bool forceRefresh) public async void RefreshImages_PopulatedItemPopulatedProviderRemote_UpdatesImagesIfForced(ImageType imageType, int imageCount, bool forceRefresh)
{ {
var item = GetItemWithImages(imageType, imageCount, false); var item = GetItemWithImages(imageType, imageCount, false);
@ -439,7 +435,7 @@ namespace Jellyfin.Providers.Tests.Manager
[MemberData(nameof(GetImageTypesWithCount))] [MemberData(nameof(GetImageTypesWithCount))]
public async void RefreshImages_EmptyItemPopulatedProviderRemoteExtras_LimitsImages(ImageType imageType, int imageCount) public async void RefreshImages_EmptyItemPopulatedProviderRemoteExtras_LimitsImages(ImageType imageType, int imageCount)
{ {
var item = new MovieWithScreenshots(); var item = new Video();
var libraryOptions = GetLibraryOptions(item, imageType, imageCount); var libraryOptions = GetLibraryOptions(item, imageType, imageCount);
@ -528,7 +524,7 @@ namespace Jellyfin.Providers.Tests.Manager
// Has to exist for querying DateModified time on file, results stored but not checked so not populating // Has to exist for querying DateModified time on file, results stored but not checked so not populating
BaseItem.FileSystem ??= Mock.Of<IFileSystem>(); BaseItem.FileSystem ??= Mock.Of<IFileSystem>();
var item = new MovieWithScreenshots(); var item = new Video();
var path = validPaths ? TestDataImagePath : "invalid path {0}"; var path = validPaths ? TestDataImagePath : "invalid path {0}";
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
@ -599,11 +595,5 @@ namespace Jellyfin.Providers.Tests.Manager
} }
}; };
} }
// Create a class that implements IHasScreenshots for testing since no BaseItem class is also IHasScreenshots
private class MovieWithScreenshots : Movie, IHasScreenshots
{
// No contents
}
} }
} }

Loading…
Cancel
Save