queue the whole song library

This commit is contained in:
vapormusic 2021-12-16 18:57:17 +07:00
parent 12b736baa0
commit 5b2da36ae1
3 changed files with 12 additions and 2 deletions

View file

@ -1571,11 +1571,20 @@ const app = new Vue({
var id = parent.substring(parent.indexOf(":")+1 , parent.length)
var truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
console.log(truekind,id)
try {
if (parent == "library_songs"){
console.log("asc")
let query = app.library.songs.listing.map(item => new MusicKit.MediaItem(item));
this.mk.clearQueue().then(function (_) {
app.mk.queue.append(query)
app.mk.changeToMediaAtIndex(childIndex)
})
} else {
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)

View file

@ -254,6 +254,7 @@
let item = this.item
let parent = this.parent
let childIndex = this.index
console.log(item,parent,childIndex)
if (parent != null && childIndex != null) {
app.queueParentandplayChild(parent, childIndex);
} else {

View file

@ -41,6 +41,6 @@
</div>
</div>
<div v-if="library.songs.downloadState == 3">Library contains no songs.</div>
<mediaitem-list-item :item="item" :index="index" :show-meta-data="true" :show-library-status="false" v-for="(item, index) in library.songs.displayListing"></mediaitem-list-item>
<mediaitem-list-item :item="item" :parent="'library_songs'" :index="index" :show-meta-data="true" :show-library-status="false" v-for="(item, index) in library.songs.displayListing"></mediaitem-list-item>
</div>
</template>