diff --git a/tests/e2e/plugins/test_split_by_chapters.py b/tests/e2e/plugins/test_split_by_chapters.py index cb02715e..bfa06823 100644 --- a/tests/e2e/plugins/test_split_by_chapters.py +++ b/tests/e2e/plugins/test_split_by_chapters.py @@ -30,35 +30,27 @@ def yt_album_as_chapters_with_regex_preset_dict(yt_album_as_chapters_preset_dict mergedeep.merge( yt_album_as_chapters_preset_dict, { - "regex": { - "from": { - # Ensure regex can handle override variables that come from the - # post-metadata stage - "chapter_title": { - "match": r"\d+\. (.+)", - "capture_group_names": "captured_track_title", - "capture_group_defaults": "{chapter_title}", - }, - "title": { - "match": [ - "(.+) - (.+) [-[\\(\\{].+", - "(.+) - (.+)", - ], - "capture_group_names": [ - "captured_track_artist", - "captured_track_album", - ], - "capture_group_defaults": [ - "{channel}", - "{title}", - ], - }, - } - }, "overrides": { - "track_title": "{captured_track_title}", - "track_album": "{captured_track_album}", - "track_artist": "{captured_track_artist}", + "title_capture": """{ + %regex_capture_many( + title, + [ + "(.+) - (.+) [-[\\(\\{].+", + "(.+) - (.+)" + ], + [ channel, title ] + ) + }""", + "chapter_title_capture": r"""{ + %regex_capture_many( + chapter_title, + [ "\d+\. (.+)" ], + [ chapter_title ] + ) + }""", + "track_title": "{%array_at(chapter_title_capture, 1)}", + "track_artist": "{%array_at(title_capture, 1)}", + "track_album": "{%array_at(title_capture, 2)}", }, }, )