uncap extended playlists queue
This commit is contained in:
parent
c858efe823
commit
18a5f5ac28
1 changed files with 27 additions and 8 deletions
|
@ -847,10 +847,10 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
await this.showCollection(responseFormat, title, "search")
|
await this.showCollection(responseFormat, title, "search")
|
||||||
},
|
},
|
||||||
async getPlaylistContinuous(response) {
|
async getPlaylistContinuous(response, transient = false) {
|
||||||
let self = this
|
let self = this
|
||||||
let playlistId = response.id
|
let playlistId = response.id
|
||||||
this.playlists.loadingState = 0
|
if (!transient) this.playlists.loadingState = 0
|
||||||
this.showingPlaylist = response
|
this.showingPlaylist = response
|
||||||
if (!response.relationships.tracks.next) {
|
if (!response.relationships.tracks.next) {
|
||||||
this.playlists.loadingState = 1
|
this.playlists.loadingState = 1
|
||||||
|
@ -874,7 +874,7 @@ const app = new Vue({
|
||||||
getPlaylistTracks(response.relationships.tracks.next)
|
getPlaylistTracks(response.relationships.tracks.next)
|
||||||
|
|
||||||
},
|
},
|
||||||
async getPlaylistFromID(id) {
|
async getPlaylistFromID(id, transient = false) {
|
||||||
let self = this
|
let self = this
|
||||||
const params = {
|
const params = {
|
||||||
include: "tracks",
|
include: "tracks",
|
||||||
|
@ -885,19 +885,18 @@ const app = new Vue({
|
||||||
"fields[catalog]": "artistUrl,albumUrl",
|
"fields[catalog]": "artistUrl,albumUrl",
|
||||||
"fields[songs]": "artistUrl,albumUrl"
|
"fields[songs]": "artistUrl,albumUrl"
|
||||||
}
|
}
|
||||||
|
if (!transient) {this.playlists.loadingState = 0;}
|
||||||
this.playlists.loadingState = 0
|
|
||||||
let playlistId = ''
|
let playlistId = ''
|
||||||
|
|
||||||
try {
|
try {
|
||||||
app.mk.api.library.playlist(id, params).then(res => {
|
app.mk.api.library.playlist(id, params).then(res => {
|
||||||
self.getPlaylistContinuous(res)
|
self.getPlaylistContinuous(res, transient)
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
try {
|
try {
|
||||||
app.mk.api.library.playlist(id, params).then(res => {
|
app.mk.api.library.playlist(id, params).then(res => {
|
||||||
self.getPlaylistContinuous(res)
|
self.getPlaylistContinuous(res, transient)
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
|
@ -2296,6 +2295,26 @@ const app = new Vue({
|
||||||
app.mk.stop()
|
app.mk.stop()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
|
if (truekind == "playlists" && (id.startsWith("p.") || id.startsWith("pl.u"))){
|
||||||
|
app.mk.playNext({[item.attributes.playParams.kind ?? item.type]: item.attributes.playParams.id ?? item.id}).then(function () {
|
||||||
|
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.id) ?? 1)
|
||||||
|
app.mk.play().then(function(){
|
||||||
|
app.mk.clearQueue().then(function () {
|
||||||
|
if ((app.showingPlaylist && app.showingPlaylist.id == id)) {
|
||||||
|
let query = app.showingPlaylist.relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
|
||||||
|
app.mk.queue.append(query)
|
||||||
|
} else {
|
||||||
|
app.getPlaylistFromID(id, true).then(function () {
|
||||||
|
let query = app.showingPlaylist.relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
|
||||||
|
app.mk.queue.append(query)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else{
|
||||||
this.mk.setQueue({[truekind]: [id]}).then(function (queue) {
|
this.mk.setQueue({[truekind]: [id]}).then(function (queue) {
|
||||||
if (item && ((queue._itemIDs[childIndex] != item.id))) {
|
if (item && ((queue._itemIDs[childIndex] != item.id))) {
|
||||||
childIndex = queue._itemIDs.indexOf(item.id)
|
childIndex = queue._itemIDs.indexOf(item.id)
|
||||||
|
@ -2310,7 +2329,7 @@ const app = new Vue({
|
||||||
} else {
|
} else {
|
||||||
app.mk.play()
|
app.mk.play()
|
||||||
}
|
}
|
||||||
})
|
})}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue