From 08e4f959a215911e98c5f90c36e407e7fd2b4ed6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 28 Apr 2013 10:18:17 -0400 Subject: fixes #207 - Music Content Showing as TV Content (songs as episodes) --- .../Resolvers/EntityResolutionHelper.cs | 31 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs') diff --git a/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs b/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs index 627e1f08d..8a6225104 100644 --- a/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs +++ b/MediaBrowser.Controller/Resolvers/EntityResolutionHelper.cs @@ -17,7 +17,7 @@ namespace MediaBrowser.Controller.Resolvers /// Any extension in this list is considered a video file - can be added to at runtime for extensibility /// public static List VideoFileExtensions = new List - { + { ".mkv", ".m2t", ".m2ts", @@ -44,6 +44,33 @@ namespace MediaBrowser.Controller.Resolvers ".webm" }; + /// + /// The audio file extensions + /// + private static readonly string[] AudioFileExtensions = new[] { + ".mp3", + ".flac", + ".wma", + ".aac", + ".acc", + ".m4a", + ".m4b", + ".wav", + ".ape", + ".ogg", + ".oga" + }; + + /// + /// Determines whether [is audio file] [the specified args]. + /// + /// The path. + /// true if [is audio file] [the specified args]; otherwise, false. + public static bool IsAudioFile(string path) + { + return AudioFileExtensions.Contains(Path.GetExtension(path), StringComparer.OrdinalIgnoreCase); + } + /// /// Determines whether [is video file] [the specified path]. /// @@ -51,7 +78,7 @@ namespace MediaBrowser.Controller.Resolvers /// true if [is video file] [the specified path]; otherwise, false. public static bool IsVideoFile(string path) { - var extension = Path.GetExtension(path) ?? string.Empty; + var extension = Path.GetExtension(path) ?? String.Empty; return VideoFileExtensions.Contains(extension, StringComparer.OrdinalIgnoreCase); } -- cgit v1.2.3