handle filenotfound in created_date

+ move store loaders up in populate.py
This commit is contained in:
mungai-njoroge
2023-12-13 23:15:25 +03:00
parent c451c0e329
commit 300c614a2f
7 changed files with 23 additions and 8 deletions
+5 -1
View File
@@ -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
View File
@@ -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]):
"""