mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Can now create multiple scrobbles from skipping back within a track
This commit is contained in:
parent
bb754c7911
commit
2221365536
@ -64,6 +64,16 @@ function startPlayback(artist,title,seconds) {
|
||||
console.log("Playback started!")
|
||||
if (artist == currentArtist && title == currentTitle && !currentlyPlaying) {
|
||||
console.log("Still previous track!")
|
||||
while (alreadyPlayed > currentLength) {
|
||||
console.log("This song is being played several times in a row!")
|
||||
if (!alreadyScrobbled) {
|
||||
scrobble(currentArtist,currentTitle)
|
||||
//alreadyScrobbled = true
|
||||
}
|
||||
alreadyPlayed = alreadyPlayed - currentLength
|
||||
alreadyScrobbled = false
|
||||
|
||||
}
|
||||
d = new Date()
|
||||
t = Math.floor(d.getTime()/1000)
|
||||
lastUpdate = t
|
||||
|
@ -1,13 +1,3 @@
|
||||
//activeLibrary = document.querySelector("[data-qa-id*=sidebarLibrariesList]").querySelector("[class*=Link-isSelected]")
|
||||
|
||||
//currentArtist = ""
|
||||
//currentTitle = ""
|
||||
//alreadyPlayed = 0
|
||||
//maxLength = 0
|
||||
//lastUpdate = 0
|
||||
|
||||
|
||||
|
||||
bar = document.querySelector("div[class*=PlayerControls]")
|
||||
if (bar == null) {
|
||||
console.log("Nothing playing right now!")
|
||||
|
@ -24,12 +24,9 @@ def mainpage():
|
||||
@route("/db/<pth:path>")
|
||||
def database(pth):
|
||||
keys = FormsDict.decode(request.query) # The Dal★Shabet handler
|
||||
for k in keys:
|
||||
print(keys[k])
|
||||
keystring = "?"
|
||||
for k in keys:
|
||||
keystring += urllib.parse.quote(k) + "=" + urllib.parse.quote(keys[k]) + "&"
|
||||
print(keystring)
|
||||
contents = urllib.request.urlopen("http://localhost:" + str(DATABASE_PORT) + "/" + pth + keystring).read()
|
||||
response.content_type = "application/json"
|
||||
response.set_header("Access-Control-Allow-Origin","*")
|
||||
|
Loading…
Reference in New Issue
Block a user