diff --git a/htmlgenerators.py b/htmlgenerators.py index e1d79a6..bbe32a3 100644 --- a/htmlgenerators.py +++ b/htmlgenerators.py @@ -60,10 +60,31 @@ def removeIdentical(*dicts): return new -def getTimeDesc(timestamp): +def getTimeDesc(timestamp,short=False): import datetime tim = datetime.datetime.utcfromtimestamp(timestamp) - return tim.strftime("%d. %b %Y %I:%M %p") + if short: + now = datetime.datetime.utcnow() + datestring = "" + if tim.year < now.year: + return str(tim.year) + if tim.month < now.month: + return tim.strftime("%B") + if tim.day+1 < now.day: + return tim.strftime("%d. %B") + if tim.day+1 == now.day: + return "yesterday" + if tim.hour+1 < now.hour: + return str(now.hour - tim.hour) + " hours ago" + if tim.minute+1 < now.minute: + return str(now.minute - tim.minute) + " minutes ago" + if tim.second+10 < now.second: + return str(now.second - tim.second) + " seconds ago" + + return "just now" + return tim.strftime("%d. %b %Y") + else: + return tim.strftime("%d. %b %Y %I:%M %p") # limit a multidict to only the specified keys diff --git a/utilities.py b/utilities.py index cea4f92..ba652f0 100644 --- a/utilities.py +++ b/utilities.py @@ -301,4 +301,5 @@ def getArtistsInfo(artistlist): # async calls only cached results, now we need to get them return [getArtistInfo(a) for a in artistlist] + diff --git a/website/favicon.ico b/website/favicon.ico index 03e8803..fe291ce 100644 Binary files a/website/favicon.ico and b/website/favicon.ico differ diff --git a/website/favicon.png b/website/favicon.png index 6ef8fd5..220dc24 100644 Binary files a/website/favicon.png and b/website/favicon.png differ diff --git a/website/maloja.css b/website/maloja.css index 850c863..0bef41d 100644 --- a/website/maloja.css +++ b/website/maloja.css @@ -127,10 +127,20 @@ table td.time { } table td.icon { + /*width:20px!important; + height:20px; + background-size:cover; + background-position:center; + padding-right:6px;*/ + padding:0px; +} + +table td.icon div { width:20px; height:20px; background-size:cover; background-position:center; + margin-right:4px; } table td.artists,td.artist,td.title { @@ -279,3 +289,27 @@ table.tiles_3x3 td { width:33.333%; font-size:70% } + + + + + +/* +** +** +** SIDE LIST ON START PAGE +** +** +*/ + + + +div.sidelist { + position:absolute; + right:0px; + top:0px; + width:40%; + height:100%; + background-color:#444447; + padding-left:30px; +} diff --git a/website/scrobbles.py b/website/scrobbles.py index 2076d31..995c620 100644 --- a/website/scrobbles.py +++ b/website/scrobbles.py @@ -7,7 +7,7 @@ def replacedict(keys,dbport): from htmlgenerators import getTimeDesc, artistLink, artistLinks, trackLink, keysToUrl, pickKeys, clean clean(keys) - timekeys = pickKeys(keys,"since","to","in") + timekeys = pickKeys(keys,"since","to","in","max") limitkeys = pickKeys(keys,"artist","title","associated") # Get scrobble data diff --git a/website/start.html b/website/start.html index b79d76b..54bf645 100644 --- a/website/start.html +++ b/website/start.html @@ -108,5 +108,168 @@ + + + + + + +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +
KEY_SCROBBLE_TIME | ++ | KEY_SCROBBLE_ARTISTS | +KEY_SCROBBLE_TITLE | +