convert track_id --> trackid

This commit is contained in:
geoffrey45
2022-02-23 02:46:06 +03:00
parent 2e699f7be7
commit fe07961757
9 changed files with 23 additions and 23 deletions
+3 -3
View File
@@ -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
+1 -1
View File
@@ -207,7 +207,7 @@ class Track:
Track class
"""
track_id: str
trackid: str
title: str
artists: str
albumartist: str
+3 -3
View File
@@ -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)