test(audiobook_library): test series and number recognition
Audiobook Library CI / build (push) Successful in 47s
Audiobook Library CI / test (push) Successful in 1m11s
Audiobook Library CI / lint (push) Successful in 9s
Audiobook Library CI / install (quiethost) (push) Successful in 1s
Audiobook Library CI / install (serverhost) (push) Successful in 4s
Audiobook Library CI / install (mediahost) (push) Successful in 6s
Audiobook Library CI / install (vivohost) (push) Successful in 9s

This commit is contained in:
Lucas Vivo committed 2026-11-22 19:51:29 +01:00
1 parent da544f490e
commit 8fafb937aa
1 file changed
+19 -7
+19 -7
View File
@@ -149,18 +149,30 @@ class AudiobookTests(unittest.TestCase):
self.assertTrue(book.generate_dir_from_metadata()[0].is_relative_to(self.root)) self.assertTrue(book.generate_dir_from_metadata()[0].is_relative_to(self.root))
def test_fix_series_from_series_number_title_path(self): def test_fix_series_from_series_number_title_path(self):
examples = { examples = [
"Jack Reacher 10: The Hard Way (by Dick Hill)": "10", ("Jack Reacher 10: The Hard Way (by Dick Hill)", "10"),
"Jack Reacher 1: Killing Floor (by Dick Hill)": "1", ("Jack Reacher 1: Killing Floor (by Dick Hill)", "1"),
"Jack Reacher 28: The Secret (by Jeff Harding)": "28", ("Jack Reacher 28: The Secret (by Jeff Harding)", "28"),
} ("Jack Reacher 10 - The Hard Way", "10"),
("Jack Reacher #10: The Hard Way", "10"),
("Jack Reacher - #10 - The Hard Way", "10"),
("Jack Reacher - 10 - The Hard Way", "10"),
("Jack Reacher - Book 10 - The Hard Way", "10"),
("Jack Reacher Book 10 - The Hard Way", "10"),
("Jack Reacher: Book 10: The Hard Way", "10"),
("Jack Reacher - Band 10 - The Hard Way", "10"),
("Jack Reacher - Volume 10 - The Hard Way", "10"),
("Jack Reacher - Vol 10 - The Hard Way", "10"),
("Jack Reacher - Book 10", "10"),
("10 - The Hard Way", "10"),
("Jack Reacher - 10", "10"),
]
for path_name, number in examples.items(): for path_name, number in examples:
with self.subTest(path_name=path_name): with self.subTest(path_name=path_name):
book_dir = self.root / "Author" / path_name book_dir = self.root / "Author" / path_name
book_dir.mkdir(parents=True) book_dir.mkdir(parents=True)
book = Audiobook(book_dir, self.root) book = Audiobook(book_dir, self.root)
book.series = "Jack Reacher"
book.series_and_num = "Jack Reacher" book.series_and_num = "Jack Reacher"
book.fix_series() book.fix_series()