Merge branch 'develop' of https://github.com/Apple-Music-Electron/Cider into develop
This commit is contained in:
commit
3e5858b9b9
3 changed files with 31 additions and 21 deletions
|
@ -23,7 +23,7 @@ const MusicKitInterop = {
|
||||||
/** wsapi */
|
/** wsapi */
|
||||||
|
|
||||||
MusicKit.getInstance().addEventListener(MusicKit.Events.nowPlayingItemDidChange, async () => {
|
MusicKit.getInstance().addEventListener(MusicKit.Events.nowPlayingItemDidChange, async () => {
|
||||||
await MusicKitInterop.modifyNamesOnLocale();
|
// await MusicKitInterop.modifyNamesOnLocale();
|
||||||
if (MusicKitInterop.filterTrack(MusicKitInterop.getAttributes(), false, true) || !app.cfg.lastfm.filterLoop) {
|
if (MusicKitInterop.filterTrack(MusicKitInterop.getAttributes(), false, true) || !app.cfg.lastfm.filterLoop) {
|
||||||
global.ipcRenderer.send('nowPlayingItemDidChange', MusicKitInterop.getAttributes());
|
global.ipcRenderer.send('nowPlayingItemDidChange', MusicKitInterop.getAttributes());
|
||||||
}
|
}
|
||||||
|
|
|
@ -2804,17 +2804,17 @@ const app = new Vue({
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.mk.clearQueue().then(function (_) {
|
app.mk.queue.splice(0, app.mk.queue._itemIDs.length)
|
||||||
if (app.mk.shuffleMode == 1) {
|
if (app.mk.shuffleMode == 1) {
|
||||||
shuffleArray(query)
|
shuffleArray(query)
|
||||||
}
|
}
|
||||||
app.mk.queue.append(query)
|
app.mk.queue.append(query)
|
||||||
if (childIndex != -1) {
|
if (childIndex != -1) {
|
||||||
app.mk.changeToMediaAtIndex(childIndex)
|
app.mk.changeToMediaAtIndex(childIndex)
|
||||||
} else {
|
} else {
|
||||||
app.mk.play()
|
app.mk.play()
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (parent.startsWith('listitem-hr')) {
|
} else if (parent.startsWith('listitem-hr')) {
|
||||||
|
@ -2859,20 +2859,30 @@ const app = new Vue({
|
||||||
itemsToPlay[item.kind].push(item.id)
|
itemsToPlay[item.kind].push(item.id)
|
||||||
})
|
})
|
||||||
// loop through itemsToPlay
|
// loop through itemsToPlay
|
||||||
|
app.mk.queue.splice(0, app.mk.queue._itemIDs.length)
|
||||||
let ind = 0;
|
let ind = 0;
|
||||||
for (let kind in itemsToPlay) {
|
for (let kind in itemsToPlay) {
|
||||||
let ids = itemsToPlay[kind]
|
let ids = itemsToPlay[kind]
|
||||||
app.mk.clearQueue().then(function () {
|
if (ids.length > 0) {
|
||||||
if (ids.length > 0) {
|
if (app.mk.queue._itemIDs.length > 0) {
|
||||||
app.mk.playLater({ [kind + "s"]: itemsToPlay[kind] }).then(function() {
|
app.mk.playLater({ [kind + "s"]: itemsToPlay[kind] }).then(function () {
|
||||||
|
ind += 1;
|
||||||
|
console.log(ind, Object.keys(itemsToPlay).length)
|
||||||
|
if (ind >= Object.keys(itemsToPlay).length) {
|
||||||
|
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.attributes.playParams.id ?? item.id))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)} else {
|
||||||
|
app.mk.setQueue({ [kind + "s"]: itemsToPlay[kind] }).then(function () {
|
||||||
ind += 1;
|
ind += 1;
|
||||||
console.log(ind , Object.keys(itemsToPlay).length)
|
console.log(ind, Object.keys(itemsToPlay).length)
|
||||||
if(ind >= Object.keys(itemsToPlay).length) {
|
if (ind >= Object.keys(itemsToPlay).length) {
|
||||||
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.attributes.playParams.id ?? item.id))
|
app.mk.changeToMediaAtIndex(app.mk.queue._itemIDs.indexOf(item.attributes.playParams.id ?? item.id))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
})
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script type="text/x-template" id="remote-pair">
|
<script type="text/x-template" id="remote-pair">
|
||||||
<div style="display:flex;width:100%;height:100%;padding-top: var(--navigationBarHeight);position:absolute;top:0;left:0;">
|
<div style="display:flex;width:100%;height:100%;padding-top: var(--navigationBarHeight);position:absolute;top:0;left:0;">
|
||||||
<webview id="foo" src="https://music.apple.com/includes/commerce/account/settings?product=music&isFullscreen=true&isModal=false" style="display:inline-flex; width:100%;"></webview>
|
<webview id="foo" src="https://cider.sh" style="display:inline-flex; width:100%;"></webview>
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue