refactor: support for multiple formats
This commit is contained in:
1 parent
29ebab923d
commit
3f62e4e2d2
2 files changed
+6
-6
No files matched your search
@@ -135,8 +135,8 @@ def api_getRandomSong():
|
||||
truth = random.choice(["a", "b"])
|
||||
session["current"] = {"id": song["id"], "truth": truth}
|
||||
|
||||
truth_path = BASE_MUSIC_FILENAME_DIR + song["original"]["filename"] + ".mp3"
|
||||
random_lie_path = BASE_MUSIC_FILENAME_DIR + random.choice(song["edits"])["filename"] + ".mp3"
|
||||
truth_path = BASE_MUSIC_FILENAME_DIR + song["original"]["filename"]
|
||||
random_lie_path = BASE_MUSIC_FILENAME_DIR + random.choice(song["edits"])["filename"]
|
||||
|
||||
if truth == "a":
|
||||
path_a = truth_path
|
||||
@@ -330,11 +330,11 @@ def api_admin_add():
|
||||
BASE_MUSIC_DIR.mkdir(parents=True, exist_ok=True)
|
||||
file.save(BASE_MUSIC_DIR / filename_new)
|
||||
|
||||
stem = os.path.splitext(filename_new)[0]
|
||||
#stem = os.path.splitext(filename_new)[0]
|
||||
song = add_song({
|
||||
"name": title,
|
||||
"artist": artist,
|
||||
"original": {"filename": stem},
|
||||
"original": {"filename": filename_new},
|
||||
"edits": [],
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user