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:
parent
ecd6594290
commit
4d9a35e3eb
@ -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:
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user