non-working solution
This commit is contained in:
parent
56e1061325
commit
b9a288461e
2 changed files with 16 additions and 1 deletions
|
|
@ -14,10 +14,19 @@ def load_cache():
|
|||
"added_tracks": []
|
||||
}, f)
|
||||
with open(CACHE_FILE, "r") as f:
|
||||
return json.load(f)
|
||||
data = json.load(f)
|
||||
data.setdefault("added_artists", [])
|
||||
data.setdefault("similar_cache", {})
|
||||
data.setdefault("added_tracks", [])
|
||||
return data
|
||||
except Exception:
|
||||
return {
|
||||
"added_artists": [],
|
||||
"similar_cache": {},
|
||||
"added_tracks": []
|
||||
}
|
||||
|
||||
def save_cache(cache):
|
||||
with open(CACHE_FILE, "w") as f:
|
||||
json.dump(cache, f, indent=2)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue