mirror of
https://gitlab.com/parroquia-san-leandro/cancionero-web.git
synced 2025-04-27 23:55:57 +02:00
Create pretty-named songs and added navigation bar
This commit is contained in:
parent
ae5e6b6cf0
commit
8528131948
2 changed files with 15 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue