|
|
|
@ -67,7 +67,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|
|
|
|
string collectionType,
|
|
|
|
|
IDirectoryService directoryService)
|
|
|
|
|
{
|
|
|
|
|
if (IsInvalid(parent, collectionType, files))
|
|
|
|
|
if (IsInvalid(parent, collectionType))
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -185,7 +185,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|
|
|
|
{
|
|
|
|
|
var collectionType = args.GetCollectionType();
|
|
|
|
|
|
|
|
|
|
if (IsInvalid(args.Parent, collectionType, args.FileSystemChildren))
|
|
|
|
|
if (IsInvalid(args.Parent, collectionType))
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -193,14 +193,18 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|
|
|
|
// Find movies with their own folders
|
|
|
|
|
if (args.IsDirectory)
|
|
|
|
|
{
|
|
|
|
|
var files = args.FileSystemChildren
|
|
|
|
|
.Where(i => !LibraryManager.IgnoreFile(i, args.Parent))
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
if (string.Equals(collectionType, CollectionType.MusicVideos, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return FindMovie<MusicVideo>(args.Path, args.Parent, args.FileSystemChildren.ToList(), args.DirectoryService, collectionType);
|
|
|
|
|
return FindMovie<MusicVideo>(args.Path, args.Parent, files, args.DirectoryService, collectionType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (string.Equals(collectionType, CollectionType.HomeVideos, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return FindMovie<Video>(args.Path, args.Parent, args.FileSystemChildren.ToList(), args.DirectoryService, collectionType);
|
|
|
|
|
return FindMovie<Video>(args.Path, args.Parent, files, args.DirectoryService, collectionType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(collectionType))
|
|
|
|
@ -208,7 +212,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|
|
|
|
// Owned items should just use the plain video type
|
|
|
|
|
if (args.Parent == null)
|
|
|
|
|
{
|
|
|
|
|
return FindMovie<Video>(args.Path, args.Parent, args.FileSystemChildren.ToList(), args.DirectoryService, collectionType);
|
|
|
|
|
return FindMovie<Video>(args.Path, args.Parent, files, args.DirectoryService, collectionType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (args.HasParent<Series>())
|
|
|
|
@ -216,12 +220,12 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FindMovie<Movie>(args.Path, args.Parent, args.FileSystemChildren.ToList(), args.DirectoryService, collectionType);
|
|
|
|
|
return FindMovie<Movie>(args.Path, args.Parent, files, args.DirectoryService, collectionType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (string.Equals(collectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return FindMovie<Movie>(args.Path, args.Parent, args.FileSystemChildren.ToList(), args.DirectoryService, collectionType);
|
|
|
|
|
return FindMovie<Movie>(args.Path, args.Parent, files, args.DirectoryService, collectionType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
@ -494,7 +498,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool IsInvalid(Folder parent, string collectionType, IEnumerable<FileSystemMetadata> files)
|
|
|
|
|
private bool IsInvalid(Folder parent, string collectionType)
|
|
|
|
|
{
|
|
|
|
|
if (parent != null)
|
|
|
|
|
{
|
|
|
|
|