Fixed fullscreen queue
This commit is contained in:
parent
0459851b19
commit
5921b98619
4 changed files with 24 additions and 22 deletions
|
@ -41,6 +41,12 @@ const MusicKitInterop = {
|
|||
|
||||
/* MusicKit.Events.nowPlayingItemDidChange */
|
||||
MusicKit.getInstance().addEventListener(MusicKit.Events.nowPlayingItemDidChange, async () => {
|
||||
if (window?.localStorage) {
|
||||
window.localStorage.setItem("currentTrack", JSON.stringify(MusicKit.getInstance().nowPlayingItem));
|
||||
window.localStorage.setItem("currentTime", JSON.stringify(MusicKit.getInstance().currentPlaybackTime));
|
||||
window.localStorage.setItem("currentQueue", JSON.stringify(MusicKit.getInstance().queue?._unplayedQueueItems));
|
||||
}
|
||||
|
||||
const attributes = MusicKitInterop.getAttributes();
|
||||
if (!attributes) return;
|
||||
attributes.primaryArtist = app.cfg.connectivity.lastfm.remove_featured ? await this.fetchSongRelationships() : attributes.artistName;
|
||||
|
|
|
@ -1059,9 +1059,14 @@ const app = new Vue({
|
|||
});
|
||||
|
||||
this.mk.addEventListener(MusicKit.Events.queueItemsDidChange, () => {
|
||||
if (self.$refs.queue) {
|
||||
if (self.$refs.queue || self.$refs.fsView?.$refs?.queue) {
|
||||
setTimeout(() => {
|
||||
self.$refs.queue.updateQueue();
|
||||
if (self.$refs.fsView?.$refs?.queue) {
|
||||
self.$refs.fsView?.$refs?.queue.updateQueue();
|
||||
}
|
||||
if (self.$refs?.queue) {
|
||||
self.$refs.queue.updateQueue();
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
@ -1083,7 +1088,10 @@ const app = new Vue({
|
|||
});
|
||||
|
||||
this.mk.addEventListener(MusicKit.Events.nowPlayingItemDidChange, (a) => {
|
||||
if (self.$refs.queue) {
|
||||
if (self.$refs.fsView?.$refs?.queue) {
|
||||
self.$refs.fsView?.$refs?.queue.updateQueue();
|
||||
}
|
||||
if (self.$refs?.queue) {
|
||||
self.$refs.queue.updateQueue();
|
||||
}
|
||||
this.currentSongInfo = a;
|
||||
|
|
|
@ -47,18 +47,16 @@
|
|||
:url="(image ?? '').replace('{w}','600').replace('{h}','600')"
|
||||
></mediaitem-artwork>
|
||||
</div>
|
||||
<div class="controls-parents">
|
||||
<template v-if="app.mkReady()">
|
||||
<div class="controls-parents" v-if="app.mkReady()">
|
||||
<div class="app-playback-controls" @mouseover="app.chrome.progresshover = true"
|
||||
@mouseleave="app.chrome.progresshover = false" @contextmenu="app.nowPlayingContextMenu">
|
||||
<div class="playback-info">
|
||||
<div class="song-name">
|
||||
{{ app.mk.nowPlayingItem["attributes"]["name"] }}
|
||||
</div>
|
||||
<div
|
||||
style="display: inline-block; -webkit-box-orient: horizontal; white-space: nowrap; margin-top: 0.25vh; overflow: hidden;">
|
||||
<div style="display: inline-block; -webkit-box-orient: horizontal; white-space: nowrap; margin-top: 0.25vh; overflow: hidden;">
|
||||
<div class="item-navigate song-artist" style="display: inline-block;"
|
||||
@click="app.getNowPlayingItemDetailed(`artist`) && app.fullscreen(false)">
|
||||
@click="app.getNowPlasssyingItemDetailed(`artist`) && app.fullscreen(false)">
|
||||
{{ app.mk.nowPlayingItem["attributes"]["artistName"] }}
|
||||
</div>
|
||||
<div class="song-artist" style="display: inline-block;">
|
||||
|
@ -70,14 +68,12 @@
|
|||
(app.mk.nowPlayingItem["attributes"]["albumName"]) : "" }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="song-progress">
|
||||
<div class="song-duration" style="justify-content: space-between; height: 1px;"
|
||||
:style="[app.chrome.progresshover ? {'display': 'flex'} : {'display' : 'none'} ]">
|
||||
<p style="width: auto">{{ app.convertTime(app.getSongProgress()) }}</p>
|
||||
<p style="width: auto">{{ app.convertTime(app.mk.currentPlaybackDuration) }}</p>
|
||||
</div>
|
||||
|
||||
<input type="range" step="0.01" min="0" :style="app.progressBarStyle()"
|
||||
@input="app.playerLCD.desiredDuration = $event.target.value;app.playerLCD.userInteraction = true"
|
||||
@mouseup="app.mk.seekToTime($event.target.value);app.playerLCD.desiredDuration = 0;app.playerLCD.userInteraction = false"
|
||||
|
@ -148,20 +144,14 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="col right-col" v-if="tabMode != ''">
|
||||
<!-- <div class="fs-info">
|
||||
<div>Name</div>
|
||||
<div>Name</div>
|
||||
<div>Name</div>
|
||||
</div> -->
|
||||
<div class="col right-col" v-if="tabMode !== ''">
|
||||
<div class="lyrics-col" v-if="tabMode == 'lyrics'">
|
||||
<lyrics-view :yoffset="120" :time="time" :lyrics="lyrics"
|
||||
:richlyrics="richlyrics"></lyrics-view>
|
||||
</div>
|
||||
<div class="queue-col" v-if="tabMode == 'queue'">
|
||||
<cider-queue v-if="tabMode == 'queue'" ref="queue"></cider-queue>
|
||||
<div class="queue-col" v-else>
|
||||
<cider-queue ref="queue"></cider-queue>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -178,8 +168,6 @@
|
|||
@click="tabMode = (tabMode == 'catalog') ? '' :'catalog'"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
</transition>
|
||||
<transition name="fsModeSwitch">
|
||||
<div class="fullscreen-view-container" v-if="appMode == 'fullscreen'">
|
||||
<fullscreen-view :image="currentArtUrlRaw" :time="mk.currentPlaybackTime - lyricOffset" :lyrics="lyrics"
|
||||
<fullscreen-view ref="fsView" :image="currentArtUrlRaw" :time="mk.currentPlaybackTime - lyricOffset" :lyrics="lyrics"
|
||||
:richlyrics="richlyrics"></fullscreen-view>
|
||||
</div>
|
||||
</transition>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue