mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
handle filenotfound in created_date
+ move store loaders up in populate.py
This commit is contained in:
@@ -145,7 +145,11 @@ def get_recently_added_playlist(cutoff: int = 14):
|
||||
)
|
||||
|
||||
tracks = get_recent_tracks(cutoff)
|
||||
date = datetime.fromtimestamp(tracks[0].created_date)
|
||||
try:
|
||||
date = datetime.fromtimestamp(tracks[0].created_date)
|
||||
except IndexError:
|
||||
return playlist, []
|
||||
|
||||
playlist.last_updated = date_string_to_time_passed(create_new_date(date))
|
||||
|
||||
images = get_first_4_images(tracks=tracks)
|
||||
|
||||
+4
-2
@@ -92,6 +92,10 @@ class Populate:
|
||||
|
||||
tried_to_download_new_images = False
|
||||
|
||||
ArtistStore.load_artists(instance_key)
|
||||
AlbumStore.load_albums(instance_key)
|
||||
TrackStore.load_all_tracks(instance_key)
|
||||
|
||||
if has_connection():
|
||||
tried_to_download_new_images = True
|
||||
try:
|
||||
@@ -114,8 +118,6 @@ class Populate:
|
||||
log.warn(e)
|
||||
return
|
||||
|
||||
ArtistStore.load_artists(instance_key)
|
||||
|
||||
@staticmethod
|
||||
def remove_modified(tracks: Generator[Track, None, None]):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user