mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
convert track_id --> trackid
This commit is contained in:
+3
-3
@@ -286,13 +286,13 @@ def get_album_bio(title, artist):
|
||||
return {"bio": bio}, 200
|
||||
|
||||
|
||||
@bp.route("/file/<track_id>")
|
||||
def send_track_file(track_id):
|
||||
@bp.route("/file/<trackid>")
|
||||
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(track_id)['filepath']
|
||||
filepath = instances.songs_instance.get_song_by_id(trackid)['filepath']
|
||||
return send_file(filepath, mimetype="audio/mp3")
|
||||
except FileNotFoundError:
|
||||
return "File not found", 404
|
||||
|
||||
@@ -207,7 +207,7 @@ class Track:
|
||||
Track class
|
||||
"""
|
||||
|
||||
track_id: str
|
||||
trackid: str
|
||||
title: str
|
||||
artists: str
|
||||
albumartist: str
|
||||
|
||||
@@ -49,11 +49,11 @@ def remove_track(filepath: str) -> None:
|
||||
"""
|
||||
Removes a track from the music dict.
|
||||
"""
|
||||
track_id = instances.songs_instance.get_song_by_path(filepath)["_id"]["$oid"]
|
||||
instances.songs_instance.remove_song_by_id(track_id)
|
||||
trackid = instances.songs_instance.get_song_by_path(filepath)["_id"]["$oid"]
|
||||
instances.songs_instance.remove_song_by_id(trackid)
|
||||
|
||||
for track in api.all_the_f_music:
|
||||
if track.track_id == track_id:
|
||||
if track.trackid == trackid:
|
||||
api.all_the_f_music.remove(track)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user