From bdce6b45a2b3c319d65ec388c149acd249e3d99b Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Wed, 27 May 2020 00:14:24 -0600 Subject: [PATCH] Fixed bug where get_cached_statuses didn't return a value for all songs in some cases --- sublime/adapters/filesystem/adapter.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sublime/adapters/filesystem/adapter.py b/sublime/adapters/filesystem/adapter.py index fc133f9..9a8cce4 100644 --- a/sublime/adapters/filesystem/adapter.py +++ b/sublime/adapters/filesystem/adapter.py @@ -217,19 +217,22 @@ class FilesystemAdapter(CachingAdapter): return SongCacheStatus.NOT_CACHED + cached_statuses = {song_id: SongCacheStatus.NOT_CACHED for song_id in song_ids} try: file_models = models.CacheInfo.select().where( models.CacheInfo.cache_key == KEYS.SONG_FILE ) song_models = models.Song.select().where(models.Song.id.in_(song_ids)) - return { - s.id: compute_song_cache_status(s) - for s in prefetch(song_models, file_models) - } + cached_statuses.update( + { + s.id: compute_song_cache_status(s) + for s in prefetch(song_models, file_models) + } + ) except Exception: pass - return {song_id: SongCacheStatus.NOT_CACHED for song_id in song_ids} + return cached_statuses _playlists = None