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:
parent
b38267a09f
commit
c216aa5f24
@ -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)
|
||||
|
||||
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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 %}
|
||||
|
Loading…
Reference in New Issue
Block a user