Public Access
Serve album covers from the service, show and sort by dates
Covers are stored with the assignment and served by the service, since Music Assistant's plain-http image URLs are blocked on an https page. Search results load covers through a signed /covers proxy. Adds a fetch-covers command for imported assignments, a migration for existing databases, and sorting assignments by artist, recently assigned or recently scanned, with both dates shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,11 +13,23 @@ AUTH = {"Authorization": f"Bearer {TOKEN}"}
|
||||
class FakeLibrary:
|
||||
def __init__(self):
|
||||
self.queries = []
|
||||
self.fetched = []
|
||||
self.images = {"http://img/1": (b"\x89PNG-lateralus", "image/png")}
|
||||
|
||||
def search_albums(self, query, limit=12):
|
||||
self.queries.append(query)
|
||||
return [Album(artist="Tool", album="Lateralus", image="http://img/1")]
|
||||
|
||||
def find_album(self, artist, album):
|
||||
found = self.search_albums(album)[0]
|
||||
return found if (found.artist, found.album) == (artist, album) else None
|
||||
|
||||
def fetch_image(self, url):
|
||||
self.fetched.append(url)
|
||||
if url not in self.images:
|
||||
raise ValueError("no such image")
|
||||
return self.images[url]
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def store(tmp_path):
|
||||
|
||||
Reference in New Issue
Block a user