diff --git a/scrobbler-vivaldi-plex/background.js b/scrobbler-vivaldi-plex/background.js index df5368e..81a2aba 100644 --- a/scrobbler-vivaldi-plex/background.js +++ b/scrobbler-vivaldi-plex/background.js @@ -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 diff --git a/scrobbler-vivaldi-plex/contentScript.js b/scrobbler-vivaldi-plex/contentScript.js index a9fb50a..af4c77a 100644 --- a/scrobbler-vivaldi-plex/contentScript.js +++ b/scrobbler-vivaldi-plex/contentScript.js @@ -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!") diff --git a/server.py b/server.py index 12f39a6..71a4421 100755 --- a/server.py +++ b/server.py @@ -24,12 +24,9 @@ def mainpage(): @route("/db/") 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","*")