From 106a735b17b4626db7bf5acf3789299c809537d4 Mon Sep 17 00:00:00 2001 From: Steven Sheehy Date: Sun, 23 Nov 2025 11:08:15 -0600 Subject: [PATCH 1/5] Fix addon filtering Signed-off-by: Steven Sheehy --- .gitignore | 1 + modules/dat/process_dat.py | 3 +++ modules/titletools.py | 1 + 3 files changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 91e9bd7b..fea460d6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ !.gitignore !.dev !tests/**/*.dat +/_internal/ /config/ /config/systems/*.yaml /clonelists/ diff --git a/modules/dat/process_dat.py b/modules/dat/process_dat.py index 7a9099fe..bb8650c8 100644 --- a/modules/dat/process_dat.py +++ b/modules/dat/process_dat.py @@ -395,6 +395,9 @@ def __init__( else: self.categories.append(category) + self.categories = category_assign( + self.full_name, self.categories, (config.regex.addons,), 'Add-Ons' + ) self.categories = category_assign( self.full_name, self.categories, (config.regex.programs,), 'Applications' ) diff --git a/modules/titletools.py b/modules/titletools.py index ad084b5f..dcd43b95 100644 --- a/modules/titletools.py +++ b/modules/titletools.py @@ -125,6 +125,7 @@ def __init__(self, LANGUAGES: str) -> None: self.secam_2: Pattern[str] = re.compile('\\[(.*)?SECAM(.*)?\\]') # Other tags + self.addons: Pattern[str] = re.compile('\\((Addon( for XBLA)?|DLC|Update)\\)', flags=re.I) self.aftermarket: Pattern[str] = re.compile('\\(Aftermarket\\)', flags=re.I) self.alt: Pattern[str] = re.compile('\\(Alt.*?\\)', flags=re.I) self.bad: Pattern[str] = re.compile('\\[b\\]', flags=re.I) From 00af9b047eb47e36d8b79b613fe72f2c10d0d223 Mon Sep 17 00:00:00 2001 From: Steven Sheehy Date: Sun, 23 Nov 2025 16:19:38 -0600 Subject: [PATCH 2/5] Add tests Signed-off-by: Steven Sheehy --- modules/titletools.py | 4 ++- ...ol - Exclusions [-aAbBcdDefkmMopPruv].dat} | 3 +-- tests/source/features/Retool - Exclusions.dat | 25 +++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) rename tests/goldens/features/exclusions/{Retool - Exclusions (-x) [-aAbBcdDefkmMopPruv].dat => Retool - Exclusions [-aAbBcdDefkmMopPruv].dat} (83%) diff --git a/modules/titletools.py b/modules/titletools.py index dcd43b95..b6a31d12 100644 --- a/modules/titletools.py +++ b/modules/titletools.py @@ -125,7 +125,9 @@ def __init__(self, LANGUAGES: str) -> None: self.secam_2: Pattern[str] = re.compile('\\[(.*)?SECAM(.*)?\\]') # Other tags - self.addons: Pattern[str] = re.compile('\\((Addon( for XBLA)?|DLC|Update)\\)', flags=re.I) + self.addons: Pattern[str] = re.compile( + '\\((Addon( for XBLA)?|DLC|(Title )?Update)\\)', flags=re.I + ) self.aftermarket: Pattern[str] = re.compile('\\(Aftermarket\\)', flags=re.I) self.alt: Pattern[str] = re.compile('\\(Alt.*?\\)', flags=re.I) self.bad: Pattern[str] = re.compile('\\[b\\]', flags=re.I) diff --git a/tests/goldens/features/exclusions/Retool - Exclusions (-x) [-aAbBcdDefkmMopPruv].dat b/tests/goldens/features/exclusions/Retool - Exclusions [-aAbBcdDefkmMopPruv].dat similarity index 83% rename from tests/goldens/features/exclusions/Retool - Exclusions (-x) [-aAbBcdDefkmMopPruv].dat rename to tests/goldens/features/exclusions/Retool - Exclusions [-aAbBcdDefkmMopPruv].dat index 85899ee6..85cd4d5c 100644 --- a/tests/goldens/features/exclusions/Retool - Exclusions (-x) [-aAbBcdDefkmMopPruv].dat +++ b/tests/goldens/features/exclusions/Retool - Exclusions [-aAbBcdDefkmMopPruv].dat @@ -3,7 +3,7 @@
Retool - Exclusions (Retool) - Retool - Exclusions (1) (-x) [-aAbBcdDefkmMopPruv] (2024-02-24 00-00-00) (Retool) + Retool - Exclusions (1) [-aAbBcdDefkmMopPruv] (2024-02-24 00-00-00) (Retool) 2024-02-24 00-00-00 2023-06-17 00-00-00 unexpectedpanda @@ -14,7 +14,6 @@ Games Test Title 0 (USA) - diff --git a/tests/source/features/Retool - Exclusions.dat b/tests/source/features/Retool - Exclusions.dat index 9e0f631e..e23b37a1 100644 --- a/tests/source/features/Retool - Exclusions.dat +++ b/tests/source/features/Retool - Exclusions.dat @@ -20,6 +20,31 @@ Test Title 1 (USA) + + + Test Title 51 (USA) (Addon) + + + + + TTest Title 52 (USA) (DLC) + + + + + TTest Title 53 (USA) (update) + + + + + TTest Title 54 (USA) (Title Update) + + + + + TTest Title 55 (USA) (addon for xbla) + + From aa6bd092ad7eab277898678ec6f84770b5058a94 Mon Sep 17 00:00:00 2001 From: Steven Sheehy Date: Mon, 24 Nov 2025 22:46:11 -0600 Subject: [PATCH 3/5] Fix title Signed-off-by: Steven Sheehy --- tests/source/features/Retool - Exclusions.dat | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/source/features/Retool - Exclusions.dat b/tests/source/features/Retool - Exclusions.dat index e23b37a1..91ee5ec0 100644 --- a/tests/source/features/Retool - Exclusions.dat +++ b/tests/source/features/Retool - Exclusions.dat @@ -27,22 +27,22 @@ - TTest Title 52 (USA) (DLC) + Test Title 52 (USA) (DLC) - TTest Title 53 (USA) (update) + Test Title 53 (USA) (update) - TTest Title 54 (USA) (Title Update) + Test Title 54 (USA) (Title Update) - TTest Title 55 (USA) (addon for xbla) + Test Title 55 (USA) (addon for xbla) From 9ca6d3c9fc85efd8f17c38ce3ae58dcd070f65e3 Mon Sep 17 00:00:00 2001 From: Steven Sheehy Date: Sat, 29 Nov 2025 21:10:43 -0600 Subject: [PATCH 4/5] Address review feedback Signed-off-by: Steven Sheehy --- .gitignore | 3 +-- modules/titletools.py | 2 +- ...ool - Exclusions [-aAbBcdDefkmMopPruv].dat | 3 ++- tests/source/features/Retool - Exclusions.dat | 20 +++++-------------- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index fea460d6..41584249 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ !.gitignore !.dev !tests/**/*.dat -/_internal/ /config/ /config/systems/*.yaml /clonelists/ @@ -37,4 +36,4 @@ debug.log npm-debug.log* yarn-debug.log* -yarn-error.log* \ No newline at end of file +yarn-error.log* diff --git a/modules/titletools.py b/modules/titletools.py index b6a31d12..a9db2598 100644 --- a/modules/titletools.py +++ b/modules/titletools.py @@ -126,7 +126,7 @@ def __init__(self, LANGUAGES: str) -> None: # Other tags self.addons: Pattern[str] = re.compile( - '\\((Addon( for XBLA)?|DLC|(Title )?Update)\\)', flags=re.I + '\\((?:Addon(?: for XBLA)?|DLC)\\)', flags=re.I ) self.aftermarket: Pattern[str] = re.compile('\\(Aftermarket\\)', flags=re.I) self.alt: Pattern[str] = re.compile('\\(Alt.*?\\)', flags=re.I) diff --git a/tests/goldens/features/exclusions/Retool - Exclusions [-aAbBcdDefkmMopPruv].dat b/tests/goldens/features/exclusions/Retool - Exclusions [-aAbBcdDefkmMopPruv].dat index 85cd4d5c..bc92cd1a 100644 --- a/tests/goldens/features/exclusions/Retool - Exclusions [-aAbBcdDefkmMopPruv].dat +++ b/tests/goldens/features/exclusions/Retool - Exclusions [-aAbBcdDefkmMopPruv].dat @@ -3,7 +3,7 @@
Retool - Exclusions (Retool) - Retool - Exclusions (1) [-aAbBcdDefkmMopPruv] (2024-02-24 00-00-00) (Retool) + Retool - Exclusions (-x) (1) [-aAbBcdDefkmMopPruv] (2024-02-24 00-00-00) (Retool) 2024-02-24 00-00-00 2023-06-17 00-00-00 unexpectedpanda @@ -14,6 +14,7 @@ Games Test Title 0 (USA) + diff --git a/tests/source/features/Retool - Exclusions.dat b/tests/source/features/Retool - Exclusions.dat index 91ee5ec0..054287f2 100644 --- a/tests/source/features/Retool - Exclusions.dat +++ b/tests/source/features/Retool - Exclusions.dat @@ -14,7 +14,7 @@ - + Add-Ons Test Title 1 (USA) @@ -31,20 +31,10 @@ - - Test Title 53 (USA) (update) - - - - - Test Title 54 (USA) (Title Update) - - - - - Test Title 55 (USA) (addon for xbla) - - + + Test Title 55 (USA) (Addon for XBLA) + + From 2717b7f66bac16d014cf474e192d499e64840f92 Mon Sep 17 00:00:00 2001 From: Steven Sheehy Date: Sat, 29 Nov 2025 21:20:06 -0600 Subject: [PATCH 5/5] Tweaks Signed-off-by: Steven Sheehy --- .gitignore | 2 +- ...].dat => Retool - Exclusions (-x) [-aAbBcdDefkmMopPruv].dat} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename tests/goldens/features/exclusions/{Retool - Exclusions [-aAbBcdDefkmMopPruv].dat => Retool - Exclusions (-x) [-aAbBcdDefkmMopPruv].dat} (92%) diff --git a/.gitignore b/.gitignore index 41584249..91e9bd7b 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,4 @@ debug.log npm-debug.log* yarn-debug.log* -yarn-error.log* +yarn-error.log* \ No newline at end of file diff --git a/tests/goldens/features/exclusions/Retool - Exclusions [-aAbBcdDefkmMopPruv].dat b/tests/goldens/features/exclusions/Retool - Exclusions (-x) [-aAbBcdDefkmMopPruv].dat similarity index 92% rename from tests/goldens/features/exclusions/Retool - Exclusions [-aAbBcdDefkmMopPruv].dat rename to tests/goldens/features/exclusions/Retool - Exclusions (-x) [-aAbBcdDefkmMopPruv].dat index bc92cd1a..85899ee6 100644 --- a/tests/goldens/features/exclusions/Retool - Exclusions [-aAbBcdDefkmMopPruv].dat +++ b/tests/goldens/features/exclusions/Retool - Exclusions (-x) [-aAbBcdDefkmMopPruv].dat @@ -3,7 +3,7 @@
Retool - Exclusions (Retool) - Retool - Exclusions (-x) (1) [-aAbBcdDefkmMopPruv] (2024-02-24 00-00-00) (Retool) + Retool - Exclusions (1) (-x) [-aAbBcdDefkmMopPruv] (2024-02-24 00-00-00) (Retool) 2024-02-24 00-00-00 2023-06-17 00-00-00 unexpectedpanda