Feat/auto generate edited files #2

Merged
robin merged 16 commits from feat/auto-generate-edited-files into main 2026-11-13 16:12:02 +00:00
Showing only changes of commit 47389fb0a7 - Show all commits
+10 -1
View File
@@ -14,6 +14,7 @@ from functools import wraps
from db import init_db, get_db, close_db, create_participant, now
from datetime import datetime, timezone
import threading
from mutagen import File
bp = Blueprint("main", __name__)
@@ -341,11 +342,19 @@ def api_admin_add():
BASE_MUSIC_DIR.mkdir(parents=True, exist_ok=True)
file.save(BASE_MUSIC_DIR / filename_new)
# read bitrate and sampling rate
audio = File(BASE_MUSIC_DIR / filename_new)
print(audio.info.bitrate)
#stem = os.path.splitext(filename_new)[0]
song = add_song({
"name": title,
"artist": artist,
"original": {"filename": filename_new},
"original": {
"filename": filename_new,
"sampling_rate": audio.info.sample_rate,
"bitrate": audio.info.bitrate
},
"edits": [],
})