mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-20 05:04:18 +01:00
fixes #200 - MB3 Locking Folders for a long time
This commit is contained in:
@@ -49,7 +49,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
// If list contains at least 2 audio files or at least one and no video files consider it to contain music
|
||||
var foundAudio = 0;
|
||||
|
||||
foreach (var fullName in new DirectoryInfo(path).EnumerateFiles("*", SearchOption.TopDirectoryOnly).Select(file => file.FullName))
|
||||
foreach (var fullName in new DirectoryInfo(path).EnumerateFiles().Select(file => file.FullName))
|
||||
{
|
||||
if (AudioResolver.IsAudioFile(fullName)) foundAudio++;
|
||||
if (foundAudio >= 2)
|
||||
@@ -86,19 +86,19 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
/// </summary>
|
||||
/// <param name="list">The list.</param>
|
||||
/// <returns><c>true</c> if the specified list contains music; otherwise, <c>false</c>.</returns>
|
||||
public static bool ContainsMusic(IEnumerable<WIN32_FIND_DATA> list)
|
||||
public static bool ContainsMusic(IEnumerable<FileSystemInfo> list)
|
||||
{
|
||||
// If list contains at least 2 audio files or at least one and no video files consider it to contain music
|
||||
var foundAudio = 0;
|
||||
|
||||
foreach (var file in list)
|
||||
{
|
||||
if (AudioResolver.IsAudioFile(file.Path)) foundAudio++;
|
||||
if (AudioResolver.IsAudioFile(file.FullName)) foundAudio++;
|
||||
if (foundAudio >= 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (EntityResolutionHelper.IsVideoFile(file.Path)) return false;
|
||||
if (EntityResolutionHelper.IsVideoFile(file.FullName)) return false;
|
||||
}
|
||||
|
||||
// or a single audio file and no video files
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
if (args.Parent.IsRoot) return null;
|
||||
|
||||
// If we contain an album assume we are an artist folder
|
||||
return args.FileSystemChildren.Any(i => MusicAlbumResolver.IsMusicAlbum(i.Path)) ? new MusicArtist() : null;
|
||||
return args.FileSystemChildren.Any(i => MusicAlbumResolver.IsMusicAlbum(i.FullName)) ? new MusicArtist() : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -127,9 +127,9 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||
// Loop through each child file/folder and see if we find a video
|
||||
foreach (var child in args.FileSystemChildren)
|
||||
{
|
||||
if (child.IsDirectory)
|
||||
if (child.Attributes.HasFlag(FileAttributes.Directory))
|
||||
{
|
||||
if (IsDvdDirectory(child.cFileName))
|
||||
if (IsDvdDirectory(child.Name))
|
||||
{
|
||||
return new Movie
|
||||
{
|
||||
@@ -137,7 +137,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||
VideoType = VideoType.Dvd
|
||||
};
|
||||
}
|
||||
if (IsBluRayDirectory(child.cFileName))
|
||||
if (IsBluRayDirectory(child.Name))
|
||||
{
|
||||
return new Movie
|
||||
{
|
||||
@@ -145,7 +145,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||
VideoType = VideoType.BluRay
|
||||
};
|
||||
}
|
||||
if (IsHdDvdDirectory(child.cFileName))
|
||||
if (IsHdDvdDirectory(child.Name))
|
||||
{
|
||||
return new Movie
|
||||
{
|
||||
@@ -160,7 +160,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||
var childArgs = new ItemResolveArgs(ApplicationPaths)
|
||||
{
|
||||
FileInfo = child,
|
||||
Path = child.Path
|
||||
Path = child.FullName
|
||||
};
|
||||
|
||||
var item = base.Resolve(childArgs);
|
||||
|
||||
Reference in New Issue
Block a user