Fix for multi add being out of order
This commit is contained in:
parent
4c7c644f97
commit
4606f44496
1 changed files with 31 additions and 8 deletions
|
@ -104,7 +104,7 @@
|
||||||
} else {
|
} else {
|
||||||
if (app.select_hasMediaItem(this.item.attributes.playParams.id ?? this.item.id)) {
|
if (app.select_hasMediaItem(this.item.attributes.playParams.id ?? this.item.id)) {
|
||||||
app.selectedMediaItems = []
|
app.selectedMediaItems = []
|
||||||
}else{
|
} else {
|
||||||
app.selectedMediaItems = []
|
app.selectedMediaItems = []
|
||||||
app.select_selectMediaItem(this.item.attributes.playParams.id ?? this.item.id, this.item.attributes.playParams.kind ?? this.item.type)
|
app.select_selectMediaItem(this.item.attributes.playParams.id ?? this.item.id, this.item.attributes.playParams.kind ?? this.item.type)
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@
|
||||||
if (!app.select_hasMediaItem(this.item.attributes.playParams.id ?? this.item.id)) {
|
if (!app.select_hasMediaItem(this.item.attributes.playParams.id ?? this.item.id)) {
|
||||||
app.selectedMediaItems = []
|
app.selectedMediaItems = []
|
||||||
app.select_selectMediaItem(this.item.attributes.playParams.id ?? this.item.id, this.item.attributes.playParams.kind ?? this.item.type)
|
app.select_selectMediaItem(this.item.attributes.playParams.id ?? this.item.id, this.item.attributes.playParams.kind ?? this.item.type)
|
||||||
}else{
|
} else {
|
||||||
useMenu = "multiple"
|
useMenu = "multiple"
|
||||||
}
|
}
|
||||||
let menus = {
|
let menus = {
|
||||||
|
@ -124,19 +124,42 @@
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
name: `Play ${app.selectedMediaItems.length} tracks next`,
|
name: `Play ${app.selectedMediaItems.length} tracks next`,
|
||||||
action: ()=>{
|
action: () => {
|
||||||
app.selectedMediaItems.forEach(item=>{
|
let itemsToPlay = {}
|
||||||
app.mk.playNext({[item.kind]: item.id})
|
app.selectedMediaItems.forEach(item => {
|
||||||
|
if (!itemsToPlay[item.kind]) {
|
||||||
|
itemsToPlay[item.kind] = []
|
||||||
|
}
|
||||||
|
itemsToPlay[item.kind].push(item.id)
|
||||||
})
|
})
|
||||||
|
// loop through itemsToPlay
|
||||||
|
for (let kind in itemsToPlay) {
|
||||||
|
let ids = itemsToPlay[kind]
|
||||||
|
if (ids.length > 0) {
|
||||||
|
app.mk.playNext({[kind + "s"]: itemsToPlay[kind]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(itemsToPlay)
|
||||||
app.selectedMediaItems = []
|
app.selectedMediaItems = []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: `Play ${app.selectedMediaItems.length} tracks later`,
|
name: `Play ${app.selectedMediaItems.length} tracks later`,
|
||||||
action: ()=>{
|
action: () => {
|
||||||
app.selectedMediaItems.forEach(item=>{
|
let itemsToPlay = {}
|
||||||
app.mk.playLater({[item.kind]: item.id})
|
app.selectedMediaItems.forEach(item => {
|
||||||
|
if (!itemsToPlay[item.kind]) {
|
||||||
|
itemsToPlay[item.kind] = []
|
||||||
|
}
|
||||||
|
itemsToPlay[item.kind].push(item.id)
|
||||||
})
|
})
|
||||||
|
// loop through itemsToPlay
|
||||||
|
for (let kind in itemsToPlay) {
|
||||||
|
let ids = itemsToPlay[kind]
|
||||||
|
if (ids.length > 0) {
|
||||||
|
app.mk.playLater({[kind + "s"]: itemsToPlay[kind]})
|
||||||
|
}
|
||||||
|
}
|
||||||
app.selectedMediaItems = []
|
app.selectedMediaItems = []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue