瀏覽代碼

exclude theme song from album resolution

Luke Pulverenti 12 年之前
父節點
當前提交
8c403a4dc8
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      MediaBrowser.Controller/Library/TVUtils.cs

+ 4 - 2
MediaBrowser.Controller/Library/TVUtils.cs

@@ -1,4 +1,5 @@
-using MediaBrowser.Controller.Resolvers;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Resolvers;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Globalization;
 using System.Globalization;
@@ -175,7 +176,8 @@ namespace MediaBrowser.Controller.Library
         /// <returns><c>true</c> if [is season folder] [the specified path]; otherwise, <c>false</c>.</returns>
         /// <returns><c>true</c> if [is season folder] [the specified path]; otherwise, <c>false</c>.</returns>
         private static bool IsSeasonFolder(string path)
         private static bool IsSeasonFolder(string path)
         {
         {
-            return GetSeasonNumberFromPath(path) != null && !new DirectoryInfo(path).EnumerateFiles().Any(i => EntityResolutionHelper.IsAudioFile(i.FullName));
+            // It's a season folder if it's named as such and does not contain any audio files, apart from theme.mp3
+            return GetSeasonNumberFromPath(path) != null && !new DirectoryInfo(path).EnumerateFiles().Any(i => EntityResolutionHelper.IsAudioFile(i.FullName) && !string.Equals(Path.GetFileNameWithoutExtension(i.Name), BaseItem.ThemeSongFilename));
         }
         }
 
 
         /// <summary>
         /// <summary>