From 67bedb49e46742c2ae6a40fec139e1ee738b9455 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Mon, 7 Dec 2020 19:49:08 +0100 Subject: [PATCH] Add support for more audio name formats --- src/audio_scanner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio_scanner.py b/src/audio_scanner.py index dfda494..f4cd450 100644 --- a/src/audio_scanner.py +++ b/src/audio_scanner.py @@ -17,7 +17,7 @@ def find_audios(index): res = [] for f in listdir(AUDIO_DIR): full_file = join(AUDIO_DIR, f) - re_date_match = re.match(r"^%03d_(\d{4}-[01]\d-[0-3]\d).mp3$" % index, f) + re_date_match = re.match(r"^%03d[_ ](\d{4}-[01]\d-[0-3]\d).mp3$" % index, f) if not isfile(full_file) or not re_date_match: continue date = datetime.strptime(re_date_match.group(1), "%Y-%m-%d")