queue whole playlist/album before play item
This commit is contained in:
parent
fb6965de7f
commit
9f2457e2b6
4 changed files with 37 additions and 5 deletions
|
@ -83,9 +83,9 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"build": {
|
"build": {
|
||||||
"electronVersion": "15.3.1",
|
"electronVersion": "15.3.3",
|
||||||
"electronDownload": {
|
"electronDownload": {
|
||||||
"version": "15.3.1-wvvmp",
|
"version": "15.3.3-wvvmp",
|
||||||
"mirror": "https://github.com/castlabs/electron-releases/releases/download/v"
|
"mirror": "https://github.com/castlabs/electron-releases/releases/download/v"
|
||||||
},
|
},
|
||||||
"appId": "cider",
|
"appId": "cider",
|
||||||
|
|
|
@ -228,7 +228,8 @@ const app = new Vue({
|
||||||
maximized: false,
|
maximized: false,
|
||||||
drawerOpened: false,
|
drawerOpened: false,
|
||||||
drawerState: "queue",
|
drawerState: "queue",
|
||||||
topChromeVisible: true
|
topChromeVisible: true,
|
||||||
|
progresshover: false,
|
||||||
},
|
},
|
||||||
collectionList: {
|
collectionList: {
|
||||||
response: {},
|
response: {},
|
||||||
|
@ -1512,6 +1513,22 @@ const app = new Vue({
|
||||||
this.playMediaItemById(id, kind, isLibrary, raurl)
|
this.playMediaItemById(id, kind, isLibrary, raurl)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
queueParentandplayChild(parent,childIndex,item){
|
||||||
|
var kind = parent.substring(0,parent.indexOf(":"))
|
||||||
|
var id = parent.substring(parent.indexOf(":")+1 , parent.length)
|
||||||
|
var truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
|
||||||
|
console.log(truekind,id)
|
||||||
|
try {
|
||||||
|
this.mk.setQueue({[truekind]: [id]}).then(function (queue) {
|
||||||
|
MusicKit.getInstance().changeToMediaAtIndex(childIndex)
|
||||||
|
})
|
||||||
|
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
this.playMediaItemById(item.attributes.playParams.id ?? item.id, item.attributes.playParams.kind ?? item.type, item.attributes.playParams.isLibrary ?? false, item.attributes.url)
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
friendlyTypes(type) {
|
friendlyTypes(type) {
|
||||||
// use switch statement to return friendly name for media types "songs,artists,albums,playlists,music-videos,stations,apple-curators,curators"
|
// use switch statement to return friendly name for media types "songs,artists,albums,playlists,music-videos,stations,apple-curators,curators"
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
|
@ -63,6 +63,8 @@
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
'item': {type: Object, required: true},
|
'item': {type: Object, required: true},
|
||||||
|
'parent': {type: Object, required: false},
|
||||||
|
'index': {type: Object, required: false},
|
||||||
'show-artwork': {type: Boolean, default: true},
|
'show-artwork': {type: Boolean, default: true},
|
||||||
'show-library-status': {type: Boolean, default: true},
|
'show-library-status': {type: Boolean, default: true},
|
||||||
'show-meta-data': {type: Boolean, default: false},
|
'show-meta-data': {type: Boolean, default: false},
|
||||||
|
@ -86,8 +88,14 @@
|
||||||
},
|
},
|
||||||
playTrack() {
|
playTrack() {
|
||||||
let item = this.item
|
let item = this.item
|
||||||
|
let parent = this.parent
|
||||||
|
let childIndex = this.index
|
||||||
|
if (parent != null && childIndex != null){
|
||||||
|
app.queueParentandplayChild(parent,childIndex);
|
||||||
|
} else {
|
||||||
app.playMediaItemById(item.attributes.playParams.id ?? item.id, item.attributes.playParams.kind ?? item.type, item.attributes.playParams.isLibrary ?? false, item.attributes.url)
|
app.playMediaItemById(item.attributes.playParams.id ?? item.id, item.attributes.playParams.kind ?? item.type, item.attributes.playParams.isLibrary ?? false, item.attributes.url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
|
@ -55,8 +55,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="playlist-body">
|
<div class="playlist-body">
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<mediaitem-list-item :item="item"
|
<mediaitem-list-item :item="item" :parent="getItemParent(data)" :index="index"
|
||||||
v-for="item in data.relationships.tracks.data"></mediaitem-list-item>
|
v-for="(item,index) in data.relationships.tracks.data"></mediaitem-list-item>
|
||||||
</div>
|
</div>
|
||||||
<div class="playlist-time">
|
<div class="playlist-time">
|
||||||
{{data.attributes.releaseDate}}
|
{{data.attributes.releaseDate}}
|
||||||
|
@ -78,6 +78,13 @@
|
||||||
return {
|
return {
|
||||||
editorialNotesExpanded: false,
|
editorialNotesExpanded: false,
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getItemParent: function (data) {
|
||||||
|
kind = data.attributes.playParams.kind;
|
||||||
|
id = data.attributes.playParams.id;
|
||||||
|
return `${kind}:${id}`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
Loading…
Add table
Add a link
Reference in a new issue