1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Fixed wrong caching of artists

This commit is contained in:
Krateng 2019-03-28 17:57:56 +01:00
parent ecd6594290
commit 4d9a35e3eb
4 changed files with 5 additions and 3 deletions

View File

@ -132,7 +132,7 @@ def static(name):
@webserver.route("/<name>") @webserver.route("/<name>")
def static_html(name): def static_html(name):
linkheaders = ["</maloja.css>; rel=preload; as=style"] linkheaders = ["</css/maloja.css>; rel=preload; as=style"]
keys = removeIdentical(FormsDict.decode(request.query)) keys = removeIdentical(FormsDict.decode(request.query))
with open("website/" + name + ".html") as htmlfile: with open("website/" + name + ".html") as htmlfile:

View File

@ -273,7 +273,7 @@ def cache_track(artists,title,result):
def cache_artist(artist,result): def cache_artist(artist,result):
cachedArtists[artist] = result cachedArtists[artist] = result
day = datetime.date.today().toordinal() day = datetime.date.today().toordinal()
cachedArtists[artist] = day cachedArtistsDays[artist] = day
def track_from_cache(artists,title): def track_from_cache(artists,title):
try: try:
@ -455,11 +455,13 @@ def getArtistImage(artist,fast=False):
pass pass
# do we have an api key? # do we have an api key?
apikey = settings.get_settings("LASTFM_API_KEY") apikey = settings.get_settings("LASTFM_API_KEY")
if apikey is None: return "" # DO NOT CACHE THAT if apikey is None: return "" # DO NOT CACHE THAT
# fast request only retuns cached and local results, generates redirect link for rest # fast request only retuns cached and local results, generates redirect link for rest
if fast: return "/image?artist=" + urllib.parse.quote(artist) if fast: return "/image?artist=" + urllib.parse.quote(artist)

View File

@ -1,3 +1,3 @@
<meta name="description" content='Maloja is a self-hosted music scrobble server.' /> <meta name="description" content='Maloja is a self-hosted music scrobble server.' />
<link rel="stylesheet" href="maloja.css" /> <link rel="stylesheet" href="css/maloja.css" />
<script src="javascript/search.js"></script> <script src="javascript/search.js"></script>