fix playlists

This commit is contained in:
cwilvx
2024-07-27 22:23:02 +03:00
parent b0e904c84f
commit 881e1d6581
5 changed files with 31 additions and 101 deletions
+9 -2
View File
@@ -13,6 +13,8 @@ from app import settings
from app.db.libdata import TrackTable
from app.models.track import Track
from app.store.albums import AlbumStore
from app.store.tracks import TrackStore
def create_thumbnail(image: Any, img_path: str) -> str:
"""
@@ -103,9 +105,14 @@ def duplicate_images(images: list):
def get_first_4_images(
tracks: list[Track] = [], trackhashes: list[str] = []
) -> list[dict["str", str]]:
"""
Returns images of the first 4 albums that appear in the track list.
When tracks are not passed, trackhashes need to be passed.
Tracks are then resolved from the store.
"""
if len(trackhashes) > 0:
# tracks = TrackStore.get_tracks_by_trackhashes(trackhashes)
tracks = TrackTable.get_tracks_by_trackhashes(trackhashes)
tracks = TrackStore.get_tracks_by_trackhashes(trackhashes)
albums = []