Browse Source

add ban suffix

HOME 3 months ago
parent
commit
3bd583c194
1 changed files with 17 additions and 1 deletions
  1. 17 1
      SevenRepacker/Program.cs

+ 17 - 1
SevenRepacker/Program.cs

@@ -18,8 +18,9 @@ namespace SevenRepacker
             SevenZipBase.SetLibraryPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "7z.dll"));
 #endif
             string outDir = null;
-            var banPrefix = new List<string>();
             string password = null;
+            var banPrefix = new List<string>();
+            var banSuffix = new List<string>();
 
             var inputFiles = new List<string>();
 
@@ -41,6 +42,9 @@ namespace SevenRepacker
                         case "ban-prefix":
                             banPrefix.Add(kv[1]);
                             break;
+                        case "ban-suffix":
+                            banSuffix.Add(kv[1]);
+                            break;
                         case "pass":
                             password = kv[1];
                             break;
@@ -98,6 +102,18 @@ namespace SevenRepacker
                         }
                     }
 
+                    if (!ban)
+                    {
+                        foreach (var suffix in banSuffix)
+                        {
+                            if (item.FileName.EndsWith(suffix))
+                            {
+                                ban = true;
+                                break;
+                            }
+                        }
+                    }
+
                     if (ban)
                     {
                         Console.WriteLine($"Banned: {item.FileName}");