1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Added ability to skip metadata fixing with existing known tracks

This commit is contained in:
Krateng 2020-11-06 20:43:55 +01:00
parent b38267a09f
commit c216aa5f24
3 changed files with 6 additions and 5 deletions

View File

@ -227,9 +227,10 @@ def post_scrobble(artist:Multi,**keys):
album = keys.get("album")
duration = keys.get("seconds")
time = keys.get("time")
nofix = keys.get("nofix") is not None
if time is not None: time = int(time)
return incoming_scrobble(artists,title,album=album,duration=duration,time=time)
return incoming_scrobble(artists,title,album=album,duration=duration,time=time,fix=not nofix)

View File

@ -566,13 +566,13 @@ def compare(remoteurl):
}
def incoming_scrobble(artists,title,album=None,duration=None,time=None):
artists = "/".join(artists)
def incoming_scrobble(artists,title,album=None,duration=None,time=None,fix=True):
if time is None:
time = int(datetime.datetime.now(tz=datetime.timezone.utc).timestamp())
log("Incoming scrobble (): ARTISTS: " + str(artists) + ", TRACK: " + title,module="debug")
(artists,title) = cla.fullclean(artists,title)
if fix:
(artists,title) = cla.fullclean("/".join(artists),title)
trackdict = createScrobble(artists,title,time,album,duration)
sync()

View File

@ -7,7 +7,7 @@
<script src="/rangeselect.js"></script>
<script>
function scrobble(encodedtrack) {
neo.xhttprequest('/apis/mlj_1/newscrobble?' + encodedtrack,method="POST").then(response=>{window.location.reload()});
neo.xhttprequest('/apis/mlj_1/newscrobble?nofix&' + encodedtrack,data={},method="POST").then(response=>{window.location.reload()});
}
</script>
{% endblock %}