mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 04:23:01 +00:00
major refactors
- add album page store - show loaders in beforeEnter guards - show bitrate on now playing card - etc
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user