Minor fixes

This commit is contained in:
krateng 2022-04-07 17:28:11 +02:00
parent 74f6a931a4
commit c378c9301d
5 changed files with 4 additions and 7 deletions

View File

@ -21,7 +21,6 @@ dependencies = [
"requests" "requests"
] ]
[project.scripts]
[build-system] [build-system]
requires = ["flit_core >=3.2,<4"] requires = ["flit_core >=3.2,<4"]

View File

@ -201,7 +201,6 @@ def artist_db_to_dict(row):
### DICT -> DB ### DICT -> DB
# TODO
def scrobble_dict_to_db(info): def scrobble_dict_to_db(info):
return { return {

View File

@ -58,7 +58,7 @@ def get_image_from_cache(id,table):
return None # no cache entry return None # no cache entry
def set_image_in_cache(id,table,url): def set_image_in_cache(id,table,url):
#remove_image_from_cache(id,table) remove_image_from_cache(id,table)
now = int(datetime.datetime.now().timestamp()) now = int(datetime.datetime.now().timestamp())
if url is None: if url is None:
expire = now + (malojaconfig["CACHE_EXPIRE_NEGATIVE"] * 24 * 3600) expire = now + (malojaconfig["CACHE_EXPIRE_NEGATIVE"] * 24 * 3600)
@ -73,7 +73,7 @@ def set_image_in_cache(id,table,url):
url=url, url=url,
expire=expire, expire=expire,
raw=raw raw=raw
).on_conflict_do_update() )
result = conn.execute(op) result = conn.execute(op)
def remove_image_from_cache(id,table): def remove_image_from_cache(id,table):

View File

@ -36,7 +36,6 @@ def update_jinja_environment():
# external # external
"urllib": urllib, "urllib": urllib,
"math":math, "math":math,
"print":print, # TODO: remove this
# config # config
"ranges": [ "ranges": [
('day','7 days',malojatime.today().next(-6),'day',7), ('day','7 days',malojatime.today().next(-6),'day',7),

View File

@ -83,8 +83,8 @@ function scrobble(artists,title) {
function scrobbledone(req) { function scrobbledone(req) {
result = req.response; result = req.response;
txt = result["scrobble"]["track"]["title"] + " by " + result["scrobble"]["track"]["artists"][0]; txt = result["track"]["title"] + " by " + result["track"]["artists"][0];
if (result["scrobble"]["track"]["artists"].length > 1) { if (result["track"]["artists"].length > 1) {
txt += " et al."; txt += " et al.";
} }
document.getElementById("notification").innerHTML = "Scrobbled " + txt + "!"; document.getElementById("notification").innerHTML = "Scrobbled " + txt + "!";