mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-27 04:16:47 +00:00
Merge 1e8360a8e8 into a43fd188dc
This commit is contained in:
commit
d64257b01f
2 changed files with 39 additions and 0 deletions
|
|
@ -489,6 +489,19 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
|
|||
{
|
||||
return GetMultiDiscMovie<T>(multiDiscFolders, directoryService);
|
||||
}
|
||||
else if (
|
||||
result.Items.Count == 0 &&
|
||||
(collectionType == CollectionType.movies || collectionType is null) &&
|
||||
fileSystemEntries.Any(i => string.Equals(i.Name, "movie.nfo", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return new T
|
||||
{
|
||||
Path = path,
|
||||
Name = Path.GetFileName(path),
|
||||
IsVirtualItem = true,
|
||||
IsPlaceHolder = true
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,32 @@ public class MovieResolverTests
|
|||
Assert.NotNull(movieResolver.Resolve(itemResolveArgs));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Resolve_MetadataOnlyFolder_ResolvesToMovie()
|
||||
{
|
||||
var movieResolver = new MovieResolver(Mock.Of<IImageProcessor>(), Mock.Of<ILogger<MovieResolver>>(), _namingOptions, Mock.Of<IDirectoryService>(), _videoListResolver);
|
||||
var itemResolveArgs = new ItemResolveArgs(
|
||||
Mock.Of<IServerApplicationPaths>(),
|
||||
null)
|
||||
{
|
||||
Parent = new MediaBrowser.Controller.Entities.Folder(),
|
||||
FileInfo = new FileSystemMetadata
|
||||
{
|
||||
FullName = "/movies/Upcoming Movie",
|
||||
IsDirectory = true
|
||||
},
|
||||
FileSystemChildren = [
|
||||
new FileSystemMetadata { Name = "movie.nfo", FullName = "/movies/Upcoming Movie/movie.nfo" },
|
||||
new FileSystemMetadata { Name = "poster.jpg", FullName = "/movies/Upcoming Movie/poster.jpg" }
|
||||
]
|
||||
};
|
||||
|
||||
var result = movieResolver.Resolve(itemResolveArgs);
|
||||
Assert.NotNull(result);
|
||||
Assert.True(result.IsVirtualItem);
|
||||
Assert.True(result.IsPlaceHolder);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ResolveMultiple_GivenTvShowsCollection_CreatesEpisodeItems()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue