mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Fixed image redirect issue
This commit is contained in:
parent
03a12eb4ca
commit
4994e59846
@ -83,6 +83,7 @@ def dynamic_image():
|
|||||||
keys = FormsDict.decode(request.query)
|
keys = FormsDict.decode(request.query)
|
||||||
relevant, _, _, _ = KeySplit(keys)
|
relevant, _, _, _ = KeySplit(keys)
|
||||||
result = resolveImage(**relevant)
|
result = resolveImage(**relevant)
|
||||||
|
if result == "": return ""
|
||||||
redirect(result,301)
|
redirect(result,301)
|
||||||
|
|
||||||
@webserver.route("/images/<pth:re:.*\\.jpeg>")
|
@webserver.route("/images/<pth:re:.*\\.jpeg>")
|
||||||
|
@ -259,7 +259,7 @@ def loadCache():
|
|||||||
fl.close()
|
fl.close()
|
||||||
|
|
||||||
def getTrackInfo(artists,title,fast=False):
|
def getTrackInfo(artists,title,fast=False):
|
||||||
|
|
||||||
obj = (frozenset(artists),title)
|
obj = (frozenset(artists),title)
|
||||||
filename = "-".join([re.sub("[^a-zA-Z0-9]","",artist) for artist in artists]) + "_" + re.sub("[^a-zA-Z0-9]","",title)
|
filename = "-".join([re.sub("[^a-zA-Z0-9]","",artist) for artist in artists]) + "_" + re.sub("[^a-zA-Z0-9]","",title)
|
||||||
if filename == "": filename = str(hash(obj))
|
if filename == "": filename = str(hash(obj))
|
||||||
@ -319,11 +319,13 @@ def getArtistInfo(artist,fast=False):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 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:
|
if fast:
|
||||||
return "/image?artist=" + urllib.parse.quote(artist)
|
return "/image?artist=" + urllib.parse.quote(artist)
|
||||||
|
|
||||||
|
|
||||||
result = apirequest(artist=artist)
|
result = apirequest(artist=artist)
|
||||||
if result.get("image") is not None:
|
if result.get("image") is not None:
|
||||||
cachedArtists[artist] = result["image"]
|
cachedArtists[artist] = result["image"]
|
||||||
|
@ -26,10 +26,10 @@ a:hover {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Header
|
Header (unused)
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
/**
|
||||||
div.header {
|
div.header {
|
||||||
position:fixed;
|
position:fixed;
|
||||||
height:45px;
|
height:45px;
|
||||||
@ -48,7 +48,7 @@ div.header {
|
|||||||
div.header h1 {
|
div.header h1 {
|
||||||
margin:5px;
|
margin:5px;
|
||||||
}
|
}
|
||||||
|
**/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -469,9 +469,6 @@ div.sidelist {
|
|||||||
background-color:#444447;
|
background-color:#444447;
|
||||||
padding-left:30px;
|
padding-left:30px;
|
||||||
padding-right:30px;
|
padding-right:30px;
|
||||||
/**
|
|
||||||
padding-top:60px;
|
|
||||||
**/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,6 +115,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function clearresults() {
|
function clearresults() {
|
||||||
|
window.setTimeout(reallyclear,500)
|
||||||
|
}
|
||||||
|
function reallyclear() {
|
||||||
document.getElementById("resultwrap").innerHTML = "";
|
document.getElementById("resultwrap").innerHTML = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user