mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Scrobbler now always scrobbles plays longer than 3 minutes
This commit is contained in:
parent
24c65d4acc
commit
36f7ab1670
@ -6,6 +6,10 @@ chrome.runtime.onMessage.addListener(onInternalMessage);
|
|||||||
|
|
||||||
tabManagers = {}
|
tabManagers = {}
|
||||||
|
|
||||||
|
|
||||||
|
const ALWAYS_SCROBBLE_SECONDS = 60*3;
|
||||||
|
// Longer songs are always scrobbled when playing at least 2 minutes
|
||||||
|
|
||||||
pages = {
|
pages = {
|
||||||
"Plex Web":{
|
"Plex Web":{
|
||||||
"patterns":[
|
"patterns":[
|
||||||
@ -282,7 +286,7 @@ class Controller {
|
|||||||
|
|
||||||
//ONLY CASE 2: Playback ended
|
//ONLY CASE 2: Playback ended
|
||||||
if (artist != this.currentArtist || title != this.currentTitle) {
|
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)
|
scrobble(this.currentArtist,this.currentTitle,this.alreadyPlayed)
|
||||||
this.alreadyPlayed = 0
|
this.alreadyPlayed = 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user