From 8528131948238e1b836ab39714d5208e0704c3c6 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Mon, 7 Dec 2020 18:19:15 +0100 Subject: [PATCH] Create pretty-named songs and added navigation bar --- res/page.html | 7 +++++++ src/latex_scanner.py | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/res/page.html b/res/page.html index e38672c..b341531 100644 --- a/res/page.html +++ b/res/page.html @@ -9,6 +9,13 @@

Cancionero San Leandro

+
%s diff --git a/src/latex_scanner.py b/src/latex_scanner.py index 57b2e0f..f17dcb7 100644 --- a/src/latex_scanner.py +++ b/src/latex_scanner.py @@ -124,6 +124,14 @@ class SongLoader: memorizing = False replay_index = 0 for a in find_audios(self.index): + a_split = a.audio_file.split("/") + renamed_dir = join(join(".", "audios"), "Canciones") + new_name = "%03d %s - %s - %s.mp3" % ( + current_song.number, + current_song.name, + current_song.author if current_song.author else "-", + a.date.strftime("%Y-%m-%d")) + shutil.copy2("/".join(a_split[1:]), join(renamed_dir, new_name)) current_song.add_audio(a) continue if re.match(r"\\endsong", remain):