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"
]
[project.scripts]
[build-system]
requires = ["flit_core >=3.2,<4"]

View File

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

View File

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

View File

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

View File

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