remove durationchanged as it was no longer needed

This commit is contained in:
Marie 2021-04-20 22:22:04 +02:00 committed by GitHub
parent 81a536bbdb
commit 59f8b2d0b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,6 @@ const notificationPath = `${app.getPath("userData")}/notification.jpg`;
let currentSong = "";
let player;
let currentPlayStatus = statuses.paused;
let sduration;
let barvalue;
let updatecurrent = false;
let oldcurrent;
@ -267,11 +266,10 @@ setInterval(function () {
};
const playStatusChanged = currentStatus !== currentPlayStatus;
const durationChanged = duration !== sduration;
const barvalChanged = barval !== barvalue;
const titleOrArtistChanged = currentSong !== songDashArtistTitle;
if (titleOrArtistChanged || playStatusChanged || durationChanged || barvalChanged || updatecurrent) {
if (titleOrArtistChanged || playStatusChanged || barvalChanged || updatecurrent) {
// update title and play info with new info
setTitle(songDashArtistTitle);
currentSong = songDashArtistTitle;
@ -281,6 +279,7 @@ setInterval(function () {
if(barvalue != barval) {
barvalue = barval;
oldcurrent = options.current;
options.duration = duration;
updatecurrent = true;
}
@ -297,12 +296,6 @@ setInterval(function () {
barvalue = barval;
}
if(durationChanged) {
options.duration = duration;
options.current = current;
sduration = duration;
}
const image = elements.getSongIcon();
new Promise((resolve) => {