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

Simplified scrobbler code

This commit is contained in:
Krateng
2018-11-29 13:43:45 +01:00
parent ce5e342212
commit 9bcd701287
6 changed files with 108 additions and 46 deletions

View File

@@ -1,7 +1,7 @@
bar = document.querySelector("div[class*=PlayerControls]")
if (bar == null) {
console.log("Nothing playing right now!")
chrome.runtime.sendMessage({type:"stopPlayback"})
chrome.runtime.sendMessage({type:"stopPlayback",artist:"",title:""})
exit()
}
@@ -15,7 +15,7 @@ durationSeconds = parseInt(duration.split(":")[0]) * 60 + parseInt(duration.spli
control = bar.querySelector("div[class*=PlayerControls-buttonGroupCenter] > button:nth-child(2)").getAttribute("title")
if (control == "Play") {
console.log("Not playing right now")
chrome.runtime.sendMessage({type:"stopPlayback"})
chrome.runtime.sendMessage({type:"stopPlayback",artist:artist,title:title})
//stopPlayback()
}
else if (control == "Pause") {