mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
server: move all stores to api.py
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
from typing import List
|
||||
from app import models, trackslib, albumslib, helpers
|
||||
|
||||
TRACKS = trackslib.TRACKS
|
||||
from app import models, api, albumslib, helpers
|
||||
|
||||
|
||||
def get_tracks(query: str) -> List[models.Track]:
|
||||
"""
|
||||
Gets all songs with a given title.
|
||||
"""
|
||||
tracks = [track for track in TRACKS if query.lower() in track.title.lower()]
|
||||
tracks = [track for track in api.TRACKS if query.lower() in track.title.lower()]
|
||||
return helpers.remove_duplicates(tracks)
|
||||
|
||||
|
||||
@@ -23,4 +21,4 @@ def get_artists(artist: str) -> List[models.Track]:
|
||||
"""
|
||||
Gets all songs with a given artist.
|
||||
"""
|
||||
return [track for track in TRACKS if artist.lower() in str(track.artists).lower()]
|
||||
return [track for track in api.TRACKS if artist.lower() in str(track.artists).lower()]
|
||||
|
||||
Reference in New Issue
Block a user