Create pretty-named songs and added navigation bar

This commit is contained in:
Carlos Galindo 2020-12-07 18:19:15 +01:00
parent ae5e6b6cf0
commit 8528131948
2 changed files with 15 additions and 0 deletions

View file

@ -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):