Verified Commit d9cd25b5 authored by David Sn's avatar David Sn
Browse files

Support caching for cover art images

Signed-off-by: David Sn's avatarDavid Sn <>
parent 70c5319a
......@@ -259,11 +259,16 @@ class FunkwhaleLibraryProvider(backend.LibraryProvider):
logger.debug("Handling get images: %s", uris)
result = {}
# TODO Add cache
for uri in uris:
track_id = uri.split(":")[-1]
payload = self.backend.client.get_track(track_id)
cache_key = "funkwhale:images:%s" % track_id
from_cache = self.cache.get(cache_key)
if from_cache:
result[uri] = from_cache
payload = self.backend.client.get_track(track_id)
if not payload["album"]["cover"]:
......@@ -282,6 +287,8 @@ class FunkwhaleLibraryProvider(backend.LibraryProvider):
self.cache.set(cache_key, result[uri])
return result
def search(self, query=None, uris=None, exact=False):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment