Przeglądaj źródła

Added some SeriesResolver fixes

LukePulverenti Luke Pulverenti luke pulverenti 12 lat temu
rodzic
commit
2dc9732e19
1 zmienionych plików z 17 dodań i 0 usunięć
  1. 17 0
      MediaBrowser.TV/TVUtils.cs

+ 17 - 0
MediaBrowser.TV/TVUtils.cs

@@ -100,16 +100,33 @@ namespace MediaBrowser.TV
 
         public static bool IsSeriesFolder(string path, WIN32_FIND_DATA[] fileSystemChildren)
         {
+            // A folder with more than 3 non-season folders in will not becounted as a series
+            int nonSeriesFolders = 0;
+
             for (int i = 0; i < fileSystemChildren.Length; i++)
             {
                 var child = fileSystemChildren[i];
 
+                if (child.IsHidden || child.IsSystemFile)
+                {
+                    continue;
+                }
+
                 if (child.IsDirectory)
                 {
                     if (IsSeasonFolder(child.Path))
                     {
                         return true;
                     }
+                    else
+                    {
+                        nonSeriesFolders++;
+
+                        if (nonSeriesFolders >= 3)
+                        {
+                            return false;
+                        }
+                    }
                 }
                 else
                 {