rewrite get all endpoint with stores

This commit is contained in:
cwilvx
2024-07-15 00:50:18 +03:00
parent 58c90d95b1
commit 88a72763df
3 changed files with 26 additions and 9 deletions
+8
View File
@@ -8,6 +8,7 @@ from app.db.sqlite.albumcolors import SQLiteAlbumMethods as aldb
from app.lib.tagger import create_albums
from app.models import Album, Track
from app.store.artists import ArtistStore
from app.utils import flatten
from app.utils.customlist import CustomList
from app.utils.remove_duplicates import remove_duplicates
@@ -76,6 +77,13 @@ class AlbumStore:
print("Done!")
@classmethod
def get_flat_list(cls):
"""
Returns a flat list of all albums.
"""
return [a.album for a in cls.albummap.values()]
@classmethod
def add_album(cls, album: Album):
"""