mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 17:14:42 +01:00
fixes #207 - Music Content Showing as TV Content (songs as episodes)
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Resolvers;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
{
|
||||
@@ -31,7 +28,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
|
||||
if (!args.IsDirectory)
|
||||
{
|
||||
if (IsAudioFile(args.Path))
|
||||
if (EntityResolutionHelper.IsAudioFile(args.Path))
|
||||
{
|
||||
return new Controller.Entities.Audio.Audio();
|
||||
}
|
||||
@@ -39,32 +36,5 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The audio file extensions
|
||||
/// </summary>
|
||||
public static readonly string[] AudioFileExtensions = new[] {
|
||||
".mp3",
|
||||
".flac",
|
||||
".wma",
|
||||
".aac",
|
||||
".acc",
|
||||
".m4a",
|
||||
".m4b",
|
||||
".wav",
|
||||
".ape",
|
||||
".ogg",
|
||||
".oga"
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether [is audio file] [the specified args].
|
||||
/// </summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <returns><c>true</c> if [is audio file] [the specified args]; otherwise, <c>false</c>.</returns>
|
||||
public static bool IsAudioFile(string path)
|
||||
{
|
||||
return AudioFileExtensions.Contains(Path.GetExtension(path), StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
|
||||
foreach (var fullName in new DirectoryInfo(path).EnumerateFiles().Select(file => file.FullName))
|
||||
{
|
||||
if (AudioResolver.IsAudioFile(fullName)) foundAudio++;
|
||||
if (EntityResolutionHelper.IsAudioFile(fullName)) foundAudio++;
|
||||
if (foundAudio >= 2)
|
||||
{
|
||||
return true;
|
||||
@@ -93,7 +93,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
|
||||
|
||||
foreach (var file in list)
|
||||
{
|
||||
if (AudioResolver.IsAudioFile(file.FullName)) foundAudio++;
|
||||
if (EntityResolutionHelper.IsAudioFile(file.FullName)) foundAudio++;
|
||||
if (foundAudio >= 2)
|
||||
{
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user