Fixed queue duplication bug.
This commit is contained in:
parent
d98e45b015
commit
a536e544a5
2 changed files with 3 additions and 2 deletions
|
@ -1279,7 +1279,7 @@ export class BrowserWindow {
|
||||||
BrowserWindow.win.webContents.executeJavaScript(`
|
BrowserWindow.win.webContents.executeJavaScript(`
|
||||||
window.localStorage.setItem("currentTrack", JSON.stringify(app.mk.nowPlayingItem));
|
window.localStorage.setItem("currentTrack", JSON.stringify(app.mk.nowPlayingItem));
|
||||||
window.localStorage.setItem("currentTime", JSON.stringify(app.mk.currentPlaybackTime));
|
window.localStorage.setItem("currentTime", JSON.stringify(app.mk.currentPlaybackTime));
|
||||||
window.localStorage.setItem("currentQueue", JSON.stringify(app.mk.queue.items));
|
window.localStorage.setItem("currentQueue", JSON.stringify(app.mk.queue._unplayedQueueItems));
|
||||||
ipcRenderer.send('stopGCast','');`)
|
ipcRenderer.send('stopGCast','');`)
|
||||||
BrowserWindow.win.destroy();
|
BrowserWindow.win.destroy();
|
||||||
}
|
}
|
||||||
|
|
|
@ -706,6 +706,7 @@ const app = new Vue({
|
||||||
let lastItem = window.localStorage.getItem("currentTrack")
|
let lastItem = window.localStorage.getItem("currentTrack")
|
||||||
let time = window.localStorage.getItem("currentTime")
|
let time = window.localStorage.getItem("currentTime")
|
||||||
let queue = window.localStorage.getItem("currentQueue")
|
let queue = window.localStorage.getItem("currentQueue")
|
||||||
|
app.mk.queue.position = 0; // Reset queue position.
|
||||||
if (lastItem != null) {
|
if (lastItem != null) {
|
||||||
lastItem = JSON.parse(lastItem)
|
lastItem = JSON.parse(lastItem)
|
||||||
let kind = lastItem.attributes.playParams.kind;
|
let kind = lastItem.attributes.playParams.kind;
|
||||||
|
@ -725,7 +726,7 @@ const app = new Vue({
|
||||||
if (queue != null) {
|
if (queue != null) {
|
||||||
queue = JSON.parse(queue)
|
queue = JSON.parse(queue)
|
||||||
if (queue && queue.length > 0) {
|
if (queue && queue.length > 0) {
|
||||||
let ids = queue.map(e => (e.playParams ? e.playParams.id : (e.attributes.playParams ? e.attributes.playParams.id : '')))
|
let ids = queue.map(e => (e.playParams ? e.playParams.id : (e.item.attributes.playParams ? e.item.attributes.playParams.id : '')))
|
||||||
let i = 0;
|
let i = 0;
|
||||||
if (ids.length > 0) {
|
if (ids.length > 0) {
|
||||||
for (let id of ids) {
|
for (let id of ids) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue