-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_parser.py
More file actions
47 lines (38 loc) · 1.63 KB
/
test_parser.py
File metadata and controls
47 lines (38 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""Test script for improved filename parsing."""
import sys
sys.path.insert(0, r'C:\Code\Bazinga\backend')
from app.services.quality_service import QualityProfile
import json
# Test filenames from tth-list.txt
test_filenames = [
# Basic patterns
"! (2010) (Digital) (BlurPixel-Empire).cbr",
"#DRCL midnight children v01 (2023) (Digital) (LuCaZ).cbz",
"'68 - Homefront 002 (2014) (Digital) (DR & Quinch-Empire).cbr",
"'68 01 (of 04) (2011) (digital) (jk-empire).cbz",
"#162 the diamond mountain [phantom] [indrajal comics].cbz",
"Patty Cake & Friends v2 006 (2002) (original, with missing page) (c2c) (Pyramid).cbz",
"'68 Vol 1 TPB - Better Run Through the Jungle (2012) (Digital-Empire).cbr",
"'Mazing Man 001 (1986) (Grundy-HaCsA).cbr",
"#580 - The Inimitable Birbal [amar chitra katha].cbr",
"Donald Duck (2015) 001 (Digital) (Zone-Empire).cbz",
# Edge cases from actual filelist
"100 Casualties Of War - Ghost Rider 008.cbr",
"100 Page Super Spectacular DC-04 (Weird Mystery Tales) (1971) (c2c).cbz",
"100% (2020) (Digital) (Mephisto-Empire).cbr",
"100% Biodegradable 021 (2018) (digital) (Foyle-DCP).cbr",
"100% Biodegradable - Apocalypse Special (2018) (digital) (d'argh-Empire).cbr",
]
print("=" * 100)
print("FILENAME PARSING TEST")
print("=" * 100)
for filename in test_filenames:
print(f"\nFilename: {filename}")
print("-" * 100)
parsed = QualityProfile.parse_filename(filename)
# Display non-None values
for key, value in parsed.items():
if value is not None and value != False:
print(f" {key:20s}: {value}")
print()
print("=" * 100)