mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Minor fixes
This commit is contained in:
parent
74f6a931a4
commit
c378c9301d
@ -21,7 +21,6 @@ dependencies = [
|
||||
"requests"
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
|
||||
[build-system]
|
||||
requires = ["flit_core >=3.2,<4"]
|
||||
|
@ -201,7 +201,6 @@ def artist_db_to_dict(row):
|
||||
|
||||
|
||||
### DICT -> DB
|
||||
# TODO
|
||||
|
||||
def scrobble_dict_to_db(info):
|
||||
return {
|
||||
|
@ -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):
|
||||
|
@ -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),
|
||||
|
@ -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 + "!";
|
||||
|
Loading…
Reference in New Issue
Block a user