server: move all stores to api.py

This commit is contained in:
geoffrey45
2022-03-18 19:57:31 +03:00
parent 29124ce717
commit f8710a1596
7 changed files with 37 additions and 53 deletions
+4 -8
View File
@@ -2,13 +2,9 @@ import os
from trace import Trace
from typing import List
from app import models, instances
from app import albumslib
from app import albumslib, api
from app.helpers import remove_duplicates
TRACKS: List[models.Track] = []
def create_all_tracks() -> List[models.Track]:
"""
Gets all songs under the ~/ directory.
@@ -32,15 +28,15 @@ def create_all_tracks() -> List[models.Track]:
tracks.append(models.Track(track))
TRACKS.clear()
TRACKS.extend(tracks)
api.TRACKS.clear()
api.TRACKS.extend(tracks)
def get_album_tracks(albumname, artist):
"""Returns all tracks matching an album"""
_tracks: List[models.Track] = []
for track in TRACKS:
for track in api.TRACKS:
if track.album == albumname and track.albumartist == artist:
_tracks.append(track)