@@ -1115,6 +1115,7 @@ async def rename_labels_in_playlist(
11151115 verbose ,
11161116 scorer ,
11171117 limit ,
1118+ filters ,
11181119):
11191120 """Rename playlist labels using fuzzy matching scores.
11201121
@@ -1127,6 +1128,10 @@ async def rename_labels_in_playlist(
11271128
11281129 for idx , name in enumerate (names ):
11291130 await exitcheck ()
1131+ # if the user used filters, filter everything that doesn't match any filter
1132+ if filters and not any (map (lambda x : fnmatch .fnmatch (name , x ), filters )):
1133+ unchanged_count += 1
1134+ continue
11301135 result = process .extract (name , remote_names , scorer = scorer , limit = limit or 1 )
11311136 if result :
11321137 _ , best_score , _ = result [0 ]
@@ -1268,7 +1273,7 @@ def strfy_runtime(s, urldict=None):
12681273 if rename_labels :
12691274 await rename_labels_in_playlist (
12701275 names , remote_names , score , dryrun ,
1271- playlist_path , verbose , scorer , limit
1276+ playlist_path , verbose , scorer , limit , filters
12721277 )
12731278 return
12741279 for name , destination in zip (names , dbs ):
0 commit comments