prevent theme songs from tripping up album resolver

This commit is contained in:
Luke Pulverenti 2013-09-20 11:16:58 -04:00
parent 479ac06f63
commit a2fb45ba8e

View File

@ -1,4 +1,5 @@
using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Entities.TV;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
@ -69,7 +70,16 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
foreach (var fullName in Directory.EnumerateFiles(path)) foreach (var fullName in Directory.EnumerateFiles(path))
{ {
if (EntityResolutionHelper.IsAudioFile(fullName)) foundAudio++; if (EntityResolutionHelper.IsAudioFile(fullName))
{
// Don't resolve these into audio files
if (string.Equals(Path.GetFileNameWithoutExtension(fullName), BaseItem.ThemeSongFilename) && EntityResolutionHelper.IsAudioFile(fullName))
{
continue;
}
foundAudio++;
}
if (foundAudio >= 2) if (foundAudio >= 2)
{ {
return true; return true;