Commit a8ae59b2 authored by Fjen Undso's avatar Fjen Undso
Browse files

^Cx caching once again

parent 48ba7ab5
......@@ -31,6 +31,7 @@ def get_cache(y_id):
def set_cache(tracks):
global cache_ids
for track in tracks:
y_id = ':'.join(track.uri.split(':')[1:])
cache[y_id] = track
......@@ -159,7 +160,7 @@ class YouTubeLibraryProvider(backend.LibraryProvider):
"""Return a list of tracks given an uri based on ytdl"""
if uri in cache:
logger.info("Using cached track response")
return get_cache(uri)
return [get_cache(uri)]
try:
yt_uri = call_ytdl(uri)
except:
......
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