Save complete tracks and albums to the db for faster startup

- refactor function locations
- add logger
- check for new tracks instead of re-processing all files
This commit is contained in:
geoffrey45
2022-04-21 10:16:45 +03:00
parent ef68cae625
commit d98cc0547e
22 changed files with 448 additions and 380 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ def send_track_file(trackid):
"""
try:
filepath = [
file["filepath"] for file in api.PRE_TRACKS
file["filepath"] for file in api.DB_TRACKS
if file["_id"]["$oid"] == trackid
][0]
except (FileNotFoundError, IndexError) as e:
@@ -31,5 +31,5 @@ def get_sample_track():
Returns a sample track object.
"""
return instances.songs_instance.get_song_by_album("Legends Never Die",
return instances.tracks_instance.get_song_by_album("Legends Never Die",
"Juice WRLD")