diff --git a/src/audio_scanner.py b/src/audio_scanner.py
index 5b98f7b..d798cd5 100644
--- a/src/audio_scanner.py
+++ b/src/audio_scanner.py
@@ -8,7 +8,7 @@ from datetime import datetime
def find_audios(index, audio_dir):
"""
Finds all audios in a folder that match the given index.
- Audios must be in the format [index]_[YYYY]-[MM]-[DD].mp3
+ Audios must be in the format [index].[songname].mp3
:param index: An integer denoting the song's index
:param audio_dir: The directory where the songs can be found
:return: A list of matching Audio objects
@@ -16,9 +16,8 @@ def find_audios(index, audio_dir):
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\..*\.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")
- res.append(Audio(date, join("../", full_file)))
+ res.append(Audio(join("../", full_file)))
return res
diff --git a/src/latex_scanner.py b/src/latex_scanner.py
index 26d9f6c..1d38570 100644
--- a/src/latex_scanner.py
+++ b/src/latex_scanner.py
@@ -1,7 +1,6 @@
import argparse
import os
import re
-import shutil
from django.conf import settings
from django.template import Engine, Context
@@ -141,14 +140,6 @@ class SongLoader:
replay_index = 0
if hasattr(self, "audio_dir"):
for a in find_audios(self.index, self.audio_dir):
- 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):
diff --git a/src/model.py b/src/model.py
index 6dc4d35..0b599be 100644
--- a/src/model.py
+++ b/src/model.py
@@ -200,10 +200,7 @@ class Chord:
class Audio:
- def __init__(self, date, audio_file):
- assert isinstance(date, datetime)
- self.date = date
- self.date_text = date.strftime("%A %-d de %B del %Y")
+ def __init__(self, audio_file):
self.audio_file = audio_file
def __str__(self):