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
+10 -1
View File
@@ -60,19 +60,24 @@ def add_track(filepath: str) -> None:
api.TRACKS.append(models.Track(tags))
folder = folderslib.create_folder(tags["folder"])
print(f"💙💙 {tags['folder']}")
print(folder)
if folder not in api.FOLDERS:
api.FOLDERS.append(folder)
print(f"added folder {folder.path}")
def remove_track(filepath: str) -> None:
"""
Removes a track from the music dict.
"""
print(filepath)
fpath = filepath.split("/")[-1]
try:
trackid = instances.songs_instance.get_song_by_path(filepath)["_id"]["$oid"]
except TypeError:
print(f"💙 Watchdog Error: Error removing track {filepath} TypeError")
return
instances.songs_instance.remove_song_by_id(trackid)
@@ -81,6 +86,10 @@ def remove_track(filepath: str) -> None:
if track.trackid == trackid:
api.TRACKS.remove(track)
for folder in api.FOLDERS:
if folder.path == filepath.replace(fpath, ""):
api.FOLDERS.remove(folder)
class Handler(PatternMatchingEventHandler):
files_to_process = []