major refactors

- add album page store
- show loaders in beforeEnter guards
- show bitrate on now playing card
- etc
This commit is contained in:
geoffrey45
2022-04-03 01:03:32 +03:00
parent 0c1e792839
commit dbb27734fe
26 changed files with 300 additions and 245 deletions
+6 -2
View File
@@ -4,7 +4,7 @@ Contains all the track routes.
from flask import Blueprint, send_file
from app import instances
from app import instances, api
track_bp = Blueprint("track", __name__, url_prefix="/")
@@ -15,7 +15,11 @@ def send_track_file(trackid):
Returns an audio file that matches the passed id to the client.
"""
try:
filepath = instances.songs_instance.get_song_by_id(trackid)["filepath"]
filepath = [
file["filepath"]
for file in api.PRE_TRACKS
if file["_id"]["$oid"] == trackid
][0]
return send_file(filepath, mimetype="audio/mp3")
except FileNotFoundError:
return "File not found", 404