Scrobbler now always scrobbles plays longer than 3 minutes

This commit is contained in:
krateng 2022-04-06 18:27:09 +02:00
parent 24c65d4acc
commit 36f7ab1670
1 changed files with 5 additions and 1 deletions

View File

@ -6,6 +6,10 @@ chrome.runtime.onMessage.addListener(onInternalMessage);
tabManagers = {}
const ALWAYS_SCROBBLE_SECONDS = 60*3;
// Longer songs are always scrobbled when playing at least 2 minutes
pages = {
"Plex Web":{
"patterns":[
@ -282,7 +286,7 @@ class Controller {
//ONLY CASE 2: Playback ended
if (artist != this.currentArtist || title != this.currentTitle) {
if (this.alreadyPlayed > this.currentLength / 2) {
if ((this.alreadyPlayed > this.currentLength / 2) || (this.alreadyPlayed > ALWAYS_SCROBBLE_SECONDS)) {
scrobble(this.currentArtist,this.currentTitle,this.alreadyPlayed)
this.alreadyPlayed = 0
}