示例#1
0
   protected override void SortFolder(IMediaFolder folder,
 SimpleKeyedVirtualFolder series)
   {
       foreach (var f in folder.ChildFolders.ToList()) {
       SortFolder(f, series);
         }
         foreach (var i in folder.ChildItems.ToList()) {
       try {
         var title = i.Title;
         if (string.IsNullOrWhiteSpace(title)) {
       throw new Exception("No title");
         }
         var m = regSites.Match(title);
         if (!m.Success) {
       throw new Exception("No match");
         }
         var site = m.Groups["site"].Value;
         if (string.IsNullOrEmpty(site)) {
       throw new Exception("No site");
         }
         site = site.Replace(" ", "").Replace("\t", "").Replace("-", "");
         site = regNumberStrip.Replace(site, string.Empty).TrimEnd();
         if (!regWord.IsMatch(site)) {
       throw new Exception("Not a site");
         }
         folder.RemoveResource(i);
         series.GetFolder(site.StemNameBase()).AddResource(i);
       }
       catch (Exception ex) {
         DebugFormat("{0} - {1}", ex.Message, i.Title);
         folder.RemoveResource(i);
         series.AddResource(i);
       }
         }
   }
示例#2
0
 protected override void SortFolder(IMediaFolder folder,
                                    SimpleKeyedVirtualFolder series)
 {
     foreach (var f in folder.ChildFolders.ToList())
     {
         SortFolder(f, series);
     }
     foreach (var i in folder.ChildItems.ToList())
     {
         var title = i.Title;
         if (string.IsNullOrWhiteSpace(title))
         {
             continue;
         }
         var m = regSeries.Match(title);
         if (!m.Success)
         {
             continue;
         }
         var ser = m.Groups[1].Value;
         if (string.IsNullOrEmpty(ser))
         {
             continue;
         }
         series.GetFolder(ser.StemNameBase()).AddResource(i);
         folder.RemoveResource(i);
     }
 }
示例#3
0
 protected override void SortFolder(IMediaFolder folder,
                                    SimpleKeyedVirtualFolder series)
 {
     foreach (var f in folder.ChildFolders.ToList())
     {
         SortFolder(f, series);
     }
     foreach (var i in folder.ChildItems.ToList())
     {
         try
         {
             var title = i.Title;
             if (string.IsNullOrWhiteSpace(title))
             {
                 throw new Exception("No title");
             }
             var m = regSites.Match(title);
             if (!m.Success)
             {
                 throw new Exception("No match");
             }
             var site = m.Groups["site"].Value;
             if (string.IsNullOrEmpty(site))
             {
                 throw new Exception("No site");
             }
             site = site.Replace(" ", "").Replace("\t", "").Replace("-", "");
             site = regNumberStrip.Replace(site, string.Empty).TrimEnd();
             if (!regWord.IsMatch(site))
             {
                 throw new Exception("Not a site");
             }
             folder.RemoveResource(i);
             series.GetFolder(site.StemNameBase()).AddResource(i);
         }
         catch (Exception ex)
         {
             DebugFormat("{0} - {1}", ex.Message, i.Title);
             folder.RemoveResource(i);
             series.AddResource(i);
         }
     }
 }
示例#4
0
 private void ProcessFolder(IMediaFolder root)
 {
     foreach (var f in root.ChildFolders) {
     ProcessFolder(f);
       }
       foreach (var f in root.ChildItems.ToList()) {
     if (filter.IsMatch(f.Title)) {
       continue;
     }
     root.RemoveResource(f);
       }
 }
示例#5
0
 private void ProcessFolder(IMediaFolder root)
 {
     foreach (var f in root.ChildFolders) {
     ProcessFolder(f);
       }
       foreach (var f in root.ChildItems.ToList()) {
     if (Allowed(f)) {
       continue;
     }
     root.RemoveResource(f);
       }
 }
示例#6
0
 private void ProcessFolder(IMediaFolder root)
 {
     foreach (var f in root.ChildFolders)
     {
         ProcessFolder(f);
     }
     foreach (var f in root.ChildItems.ToList())
     {
         if (DoFilter(f))
         {
             continue;
         }
         root.RemoveResource(f);
     }
 }
示例#7
0
 private void ProcessFolder(IMediaFolder root)
 {
     foreach (var f in root.ChildFolders) {
     ProcessFolder(f);
       }
       foreach (var f in root.ChildItems.ToList()) {
     var i = f as IMetaInfo;
     if (i == null) {
       continue;
     }
     if (i.InfoSize.HasValue && i.InfoSize.Value >= minSize) {
       continue;
     }
     root.RemoveResource(f);
       }
 }
示例#8
0
 private void ProcessFolder(IMediaFolder root)
 {
     foreach (var f in root.ChildFolders)
     {
         ProcessFolder(f);
     }
     foreach (var f in root.ChildItems.ToList())
     {
         var i = f as IMetaInfo;
         if (i == null)
         {
             continue;
         }
         if (i.InfoSize.HasValue && i.InfoSize.Value >= minSize)
         {
             continue;
         }
         root.RemoveResource(f);
     }
 }
示例#9
0
 private static void SortFolder(IMediaFolder folder,
                                SimpleKeyedVirtualFolder series)
 {
   foreach (var f in folder.ChildFolders.ToList()) {
     SortFolder(f, series);
   }
   foreach (var i in folder.ChildItems.ToList()) {
     var title = i.Title;
     if (string.IsNullOrWhiteSpace(title)) {
       continue;
     }
     var m = re_series.Match(title);
     if (!m.Success) {
       continue;
     }
     var ser = m.Groups[1].Value;
     if (string.IsNullOrEmpty(ser)) {
       continue;
     }
     series.GetFolder(ser.StemNameBase()).AddResource(i);
     folder.RemoveResource(i);
   }
 }