mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Significant rework of internal / URI key handling
This commit is contained in:
@@ -4,10 +4,11 @@ import database
|
||||
|
||||
def instructions(keys):
|
||||
from utilities import getArtistImage
|
||||
from htmlgenerators import artistLink, artistLinks, KeySplit
|
||||
from htmlgenerators import artistLink, artistLinks
|
||||
from urihandler import compose_querystring, uri_to_internal
|
||||
from htmlmodules import module_pulse, module_trackcharts
|
||||
|
||||
filterkeys, _, _, _ = KeySplit(keys,forceArtist=True)
|
||||
filterkeys, _, _, _ = uri_to_internal(keys,forceArtist=True)
|
||||
imgurl = getArtistImage(filterkeys["artist"],fast=True)
|
||||
pushresources = [{"file":imgurl,"type":"image"}] if imgurl.startswith("/") else []
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@ import urllib
|
||||
|
||||
def instructions(keys):
|
||||
from utilities import getArtistImage
|
||||
from htmlgenerators import KeySplit
|
||||
from urihandler import compose_querystring, uri_to_internal
|
||||
from htmlmodules import module_artistcharts, module_filterselection
|
||||
from malojatime import range_desc
|
||||
|
||||
|
||||
_, timekeys, _, amountkeys = KeySplit(keys)
|
||||
_, timekeys, _, amountkeys = uri_to_internal(keys)
|
||||
|
||||
limitstring = range_desc(**timekeys)
|
||||
|
||||
|
||||
@@ -3,11 +3,12 @@ import urllib
|
||||
|
||||
def instructions(keys):
|
||||
from utilities import getArtistImage, getTrackImage
|
||||
from htmlgenerators import artistLink, KeySplit
|
||||
from htmlgenerators import artistLink
|
||||
from urihandler import compose_querystring, uri_to_internal
|
||||
from htmlmodules import module_trackcharts, module_filterselection
|
||||
from malojatime import range_desc
|
||||
|
||||
filterkeys, timekeys, _, amountkeys = KeySplit(keys)
|
||||
filterkeys, timekeys, _, amountkeys = uri_to_internal(keys)
|
||||
|
||||
|
||||
limitstring = ""
|
||||
|
||||
@@ -4,11 +4,12 @@ import database
|
||||
|
||||
def instructions(keys):
|
||||
from utilities import getArtistImage, getTrackImage
|
||||
from htmlgenerators import artistLink, artistLinks, trackLink, scrobblesLink, keysToUrl, KeySplit
|
||||
from htmlgenerators import artistLink, artistLinks, trackLink, scrobblesLink
|
||||
from urihandler import compose_querystring, uri_to_internal
|
||||
from htmlmodules import module_pulse, module_filterselection
|
||||
from malojatime import range_desc, delimit_desc
|
||||
|
||||
filterkeys, timekeys, delimitkeys, _ = KeySplit(keys)
|
||||
filterkeys, timekeys, delimitkeys, _ = uri_to_internal(keys)
|
||||
|
||||
|
||||
# describe the scope (and creating a key for the relevant artist or track)
|
||||
|
||||
@@ -4,12 +4,13 @@ import database
|
||||
|
||||
def instructions(keys):
|
||||
from utilities import getArtistImage, getTrackImage
|
||||
from htmlgenerators import artistLink, artistLinks, trackLink, KeySplit
|
||||
from htmlgenerators import artistLink, artistLinks, trackLink
|
||||
from urihandler import compose_querystring, uri_to_internal
|
||||
from htmlmodules import module_scrobblelist, module_filterselection
|
||||
from malojatime import range_desc
|
||||
|
||||
|
||||
filterkeys, timekeys, _, amountkeys = KeySplit(keys)
|
||||
filterkeys, timekeys, _, amountkeys = uri_to_internal(keys)
|
||||
|
||||
# describe the scope
|
||||
limitstring = ""
|
||||
|
||||
@@ -3,11 +3,12 @@ import urllib
|
||||
|
||||
def instructions(keys):
|
||||
from utilities import getArtistImage, getTrackImage
|
||||
from htmlgenerators import artistLink, KeySplit
|
||||
from htmlgenerators import artistLink
|
||||
from urihandler import compose_querystring, uri_to_internal
|
||||
from htmlmodules import module_topartists, module_filterselection
|
||||
from malojatime import range_desc
|
||||
|
||||
_, timekeys, delimitkeys, _ = KeySplit(keys)
|
||||
_, timekeys, delimitkeys, _ = uri_to_internal(keys)
|
||||
|
||||
|
||||
limitstring = ""
|
||||
|
||||
@@ -3,11 +3,12 @@ import urllib
|
||||
|
||||
def instructions(keys):
|
||||
from utilities import getArtistImage, getTrackImage
|
||||
from htmlgenerators import artistLink, KeySplit
|
||||
from htmlgenerators import artistLink
|
||||
from urihandler import compose_querystring, uri_to_internal
|
||||
from htmlmodules import module_toptracks, module_filterselection
|
||||
from malojatime import range_desc
|
||||
|
||||
filterkeys, timekeys, delimitkeys, _ = KeySplit(keys)
|
||||
filterkeys, timekeys, delimitkeys, _ = uri_to_internal(keys)
|
||||
|
||||
|
||||
limitstring = ""
|
||||
|
||||
@@ -4,11 +4,12 @@ import database
|
||||
|
||||
def instructions(keys):
|
||||
from utilities import getArtistImage, getTrackImage
|
||||
from htmlgenerators import artistLinks, keysToUrl, KeySplit
|
||||
from htmlgenerators import artistLinks
|
||||
from urihandler import compose_querystring
|
||||
from htmlmodules import module_scrobblelist, module_pulse
|
||||
|
||||
|
||||
filterkeys, _, _, _ = KeySplit(keys,forceTrack=True)
|
||||
filterkeys, _, _, _ = uri_to_internal(keys,forceTrack=True)
|
||||
|
||||
track = filterkeys.get("track")
|
||||
imgurl = getTrackImage(track["artists"],track["title"],fast=True)
|
||||
@@ -40,7 +41,7 @@ def instructions(keys):
|
||||
|
||||
|
||||
replace = {"KEY_TRACKTITLE":track.get("title"),"KEY_ARTISTS":artistLinks(track.get("artists")),"KEY_SCROBBLES":scrobblesnum,"KEY_POSITION":pos,"KEY_IMAGEURL":imgurl,
|
||||
"KEY_SCROBBLELINK":keysToUrl(keys),"KEY_MEDALS":html_medals,
|
||||
"KEY_SCROBBLELINK":compose_querystring(keys),"KEY_MEDALS":html_medals,
|
||||
"KEY_SCROBBLELIST":html_scrobbles,"KEY_PULSE":html_pulse}
|
||||
|
||||
return (replace,pushresources)
|
||||
|
||||
Reference in New Issue
Block a user