Skip to content

Commit dfb97a7

Browse files
authored
Update __main__.py (#50)
* Update
1 parent ce0da5f commit dfb97a7

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

libretrofuzz/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.7.2"
1+
__version__ = "3.7.3"

libretrofuzz/__main__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "libretrofuzz"
3-
version = "3.7.2"
3+
version = "3.7.3"
44
description = "Fuzzy Retroarch thumbnail downloader"
55
authors = ["i30817 <i30817@gmail.com>"]
66
license = "MIT"

0 commit comments

Comments
 (0)