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")
|
album = keys.get("album")
|
||||||
duration = keys.get("seconds")
|
duration = keys.get("seconds")
|
||||||
time = keys.get("time")
|
time = keys.get("time")
|
||||||
|
nofix = keys.get("nofix") is not None
|
||||||
if time is not None: time = int(time)
|
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):
|
def incoming_scrobble(artists,title,album=None,duration=None,time=None,fix=True):
|
||||||
artists = "/".join(artists)
|
|
||||||
if time is None:
|
if time is None:
|
||||||
time = int(datetime.datetime.now(tz=datetime.timezone.utc).timestamp())
|
time = int(datetime.datetime.now(tz=datetime.timezone.utc).timestamp())
|
||||||
|
|
||||||
log("Incoming scrobble (): ARTISTS: " + str(artists) + ", TRACK: " + title,module="debug")
|
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)
|
trackdict = createScrobble(artists,title,time,album,duration)
|
||||||
|
|
||||||
sync()
|
sync()
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<script src="/rangeselect.js"></script>
|
<script src="/rangeselect.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function scrobble(encodedtrack) {
|
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>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user