mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
handle filenotfound in created_date
+ move store loaders up in populate.py
This commit is contained in:
@@ -37,6 +37,7 @@ class AlbumStore:
|
||||
|
||||
cls.albums = []
|
||||
|
||||
print("Loading albums... ", end="")
|
||||
tracks = remove_duplicates(TrackStore.tracks)
|
||||
tracks = sorted(tracks, key=lambda t: t.albumhash)
|
||||
grouped = groupby(tracks, lambda t: t.albumhash)
|
||||
@@ -72,6 +73,8 @@ class AlbumStore:
|
||||
_al.set_colors(colors)
|
||||
break
|
||||
|
||||
print("Done!")
|
||||
|
||||
@classmethod
|
||||
def add_album(cls, album: Album):
|
||||
"""
|
||||
|
||||
@@ -23,7 +23,7 @@ class ArtistStore:
|
||||
global ARTIST_LOAD_KEY
|
||||
ARTIST_LOAD_KEY = instance_key
|
||||
|
||||
print("Loading artists... ", end=" ")
|
||||
print("Loading artists... ", end="")
|
||||
cls.artists = get_all_artists(TrackStore.tracks, AlbumStore.albums)
|
||||
print("Done!")
|
||||
for artist in ardb.get_all_artists():
|
||||
|
||||
+5
-2
@@ -18,6 +18,8 @@ class TrackStore:
|
||||
"""
|
||||
Loads all tracks from the database into the store.
|
||||
"""
|
||||
|
||||
print("Loading tracks... ", end="")
|
||||
global TRACKS_LOAD_KEY
|
||||
TRACKS_LOAD_KEY = instance_key
|
||||
|
||||
@@ -26,14 +28,15 @@ class TrackStore:
|
||||
fav_hashes = favdb.get_fav_tracks()
|
||||
fav_hashes = " ".join([t[1] for t in fav_hashes])
|
||||
|
||||
print("\n") # adds space between progress bars and startup info
|
||||
for track in tqdm(cls.tracks, desc="Loading tracks"):
|
||||
for track in cls.tracks:
|
||||
if instance_key != TRACKS_LOAD_KEY:
|
||||
return
|
||||
|
||||
if track.trackhash in fav_hashes:
|
||||
track.is_favorite = True
|
||||
|
||||
print("Done!")
|
||||
|
||||
@classmethod
|
||||
def add_track(cls, track: Track):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user