Fix bug where it does not run if condition

This commit is contained in:
Mar0xy 2023-07-31 12:14:06 +02:00
parent 38c1f05c35
commit de8a5a1b07
No known key found for this signature in database
GPG Key ID: 56569BBE47D2C828

View File

@ -377,8 +377,13 @@ function updateMediaInfo(options: Options, notify: boolean) {
}; };
player.playbackStatus = options.status == statuses.paused ? "Paused" : "Playing"; player.playbackStatus = options.status == statuses.paused ? "Paused" : "Playing";
} }
if (settingsStore.get(settings.ListenBrainz.enabled) && (ListenBrainzStore.get("OldData") as string[][1]) !== options.title) { if (settingsStore.get(settings.ListenBrainz.enabled)) {
ListenBrainz.scrobble(options.title, options.artists, options.status, convertDuration(options.duration)); const data = ListenBrainzStore.get("OldData") as string[];
if (data && data[1] !== options.title) {
ListenBrainz.scrobble(options.title, options.artists, options.status, convertDuration(options.duration));
} else if (!data) {
ListenBrainz.scrobble(options.title, options.artists, options.status, convertDuration(options.duration));
}
} }
} }
} }