port recents endpoints to use stores

This commit is contained in:
cwilvx
2024-07-19 23:07:22 +03:00
parent 2a1f178da2
commit 8f592a4636
7 changed files with 90 additions and 68 deletions
+3 -5
View File
@@ -125,11 +125,9 @@ class AlbumStore:
"""
Returns an album by its hash.
"""
for album in cls.albums:
if album.albumhash == albumhash:
return album
return None
entry = cls.albummap.get(albumhash)
if entry is not None:
return entry.album
@classmethod
def get_albums_by_hashes(cls, albumhashes: Iterable[str]) -> list[Album]: