Converted the Sublime Music Adapter API classes to ABCs

This commit is contained in:
Sumner Evans
2020-04-19 23:46:45 -06:00
parent dc19098aeb
commit b740729ca0
28 changed files with 341 additions and 7627 deletions

View File

@@ -1,7 +1,7 @@
import logging
from dataclasses import asdict
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
from typing import Any, Dict, Sequence, Optional, Tuple
from playhouse.sqliteq import SqliteQueueDatabase
@@ -60,7 +60,7 @@ class FilesystemAdapter(CachingAdapter):
# =========================================================================
can_get_playlists: bool = True
def get_playlists(self) -> List[Playlist]:
def get_playlists(self) -> Sequence[Playlist]:
playlists = list(database.Playlist.select())
if len(playlists) == 0: # TODO not necessarily a cache miss
raise CacheMissError()