mirror of
https://github.com/KDE/kasts.git
synced 2025-02-06 20:33:52 +01:00
Fix switch to next track on removing currently playing track from Queue
This commit is contained in:
parent
07afc98978
commit
da456a19f9
@ -49,11 +49,12 @@ Kirigami.ScrollablePage {
|
|||||||
Connections {
|
Connections {
|
||||||
target: entry
|
target: entry
|
||||||
function onQueueStatusChanged() {
|
function onQueueStatusChanged() {
|
||||||
console.log(entry, entry.queueStatus, pageStack.get(0).lastEntry, entry.id)
|
|
||||||
if (entry.queueStatus === false) {
|
if (entry.queueStatus === false) {
|
||||||
|
// this entry has just been removed from the queue
|
||||||
if (pageStack.depth > 1) {
|
if (pageStack.depth > 1) {
|
||||||
if (pageStack.get(0).lastEntry) {
|
if (pageStack.get(0).lastEntry) {
|
||||||
if (pageStack.get(0).lastEntry === entry.id) {
|
if (pageStack.get(0).lastEntry === entry.id) {
|
||||||
|
// if this EntryPage was open, then close it
|
||||||
pageStack.pop()
|
pageStack.pop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,6 +100,10 @@ Kirigami.ScrollablePage {
|
|||||||
if(!entry.queueStatus) {
|
if(!entry.queueStatus) {
|
||||||
entry.queueStatus = true
|
entry.queueStatus = true
|
||||||
} else {
|
} else {
|
||||||
|
// first change to next track if this one is playing
|
||||||
|
if (entry === audio.entry) {
|
||||||
|
audio.next()
|
||||||
|
}
|
||||||
entry.queueStatus = false
|
entry.queueStatus = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user