mitigate skipping on some library songs
This commit is contained in:
parent
5c56dfbcc3
commit
317a56e439
6 changed files with 13 additions and 5 deletions
|
@ -182,7 +182,8 @@ export class wsapi {
|
|||
response.message = "Unmuted";
|
||||
break;
|
||||
case "next":
|
||||
this._win.webContents.executeJavaScript(`MusicKit.getInstance().skipToNextItem()`);
|
||||
this._win.webContents.executeJavaScript(`if (MusicKit.getInstance().queue.nextPlayableItemIndex != -1) {
|
||||
MusicKit.getInstance().changeToMediaAtIndex(MusicKit.getInstance().queue.nextPlayableItemIndex);}`);
|
||||
response.message = "Next";
|
||||
break;
|
||||
case "previous":
|
||||
|
|
|
@ -127,7 +127,9 @@ const MusicKitInterop = {
|
|||
},
|
||||
|
||||
next: () => {
|
||||
MusicKit.getInstance().skipToNextItem().then(r => console.log(`[MusicKitInterop.next] Skipping to Next ${r}`));
|
||||
if (MusicKit.getInstance().queue.nextPlayableItemIndex != -1)
|
||||
MusicKit.getInstance().changeToMediaAtIndex(MusicKit.getInstance().queue.nextPlayableItemIndex);
|
||||
// MusicKit.getInstance().skipToNextItem().then(r => console.log(`[MusicKitInterop.next] Skipping to Next ${r}`));
|
||||
},
|
||||
|
||||
previous: () => {
|
||||
|
|
|
@ -3730,6 +3730,11 @@ const app = new Vue({
|
|||
if (sellang.startsWith("en") && this.mk.storefrontId != "us") sellang = "en-gb"
|
||||
return await sellang
|
||||
}
|
||||
},
|
||||
skipToNextItem(){
|
||||
// app.mk.skipToNextItem() is buggy somehow so use this
|
||||
if (this.mk.queue.nextPlayableItemIndex != -1)
|
||||
this.mk.changeToMediaAtIndex(this.mk.queue.nextPlayableItemIndex);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -137,7 +137,7 @@
|
|||
<button class="playback-button play" @click="mk.play()" v-else></button>
|
||||
</div>
|
||||
<div class="app-chrome-item">
|
||||
<button class="playback-button next" @click="mk.skipToNextItem()"></button>
|
||||
<button class="playback-button next" @click="skipToNextItem()"></button>
|
||||
</div>
|
||||
<div class="app-chrome-item">
|
||||
<button class="playback-button--small repeat" v-if="mk.repeatMode == 0"
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
<button class="playback-button play" @click="app.mk.play()" v-else></button>
|
||||
</div>
|
||||
<div class="app-chrome-item">
|
||||
<button class="playback-button next" @click="app.mk.skipToNextItem()"></button>
|
||||
<button class="playback-button next" @click="app.skipToNextItem()"></button>
|
||||
</div>
|
||||
<div class="app-chrome-item">
|
||||
<button class="playback-button--small repeat" v-if="app.mk.repeatMode == 0"
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
<button class="playback-button play" @click="app.mk.play()" v-else></button>
|
||||
</div>
|
||||
<div class="app-chrome-item">
|
||||
<button class="playback-button next" @click="app.mk.skipToNextItem()"></button>
|
||||
<button class="playback-button next" @click="app.skipToNextItem()"></button>
|
||||
</div>
|
||||
<div class="app-chrome-item">
|
||||
<button class="playback-button--small repeat" v-if="app.mk.repeatMode == 0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue