Fix playback
This commit is contained in:
parent
a77fb4e6ac
commit
89b2c052b9
|
@ -261,9 +261,9 @@ const coverType = useStorage('queue:cover-type', CoverType.COVER_ART)
|
||||||
>
|
>
|
||||||
<h1>{{ currentTrack.title }}</h1>
|
<h1>{{ currentTrack.title }}</h1>
|
||||||
<h2>
|
<h2>
|
||||||
{{ currentTrack.artistName }}
|
{{ currentTrack.artistName ?? $t('components.Queue.meta.unknownArtist') }}
|
||||||
<span class="symbol hyphen middle" />
|
<span class="symbol hyphen middle" />
|
||||||
{{ currentTrack.albumTitle }}
|
{{ currentTrack.albumTitle ?? $t('components.Queue.meta.unknownAlbum') }}
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
</Transition>
|
</Transition>
|
||||||
|
@ -282,7 +282,7 @@ const coverType = useStorage('queue:cover-type', CoverType.COVER_ART)
|
||||||
class="discrete link artist"
|
class="discrete link artist"
|
||||||
:to="{name: 'library.artists.detail', params: {id: currentTrack.artistId }}"
|
:to="{name: 'library.artists.detail', params: {id: currentTrack.artistId }}"
|
||||||
>
|
>
|
||||||
{{ currentTrack.artistName }}
|
{{ currentTrack.artistName ?? $t('components.Queue.meta.unknownArtist') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<template v-if="currentTrack.albumId !== -1">
|
<template v-if="currentTrack.albumId !== -1">
|
||||||
<span class="middle slash symbol" />
|
<span class="middle slash symbol" />
|
||||||
|
@ -290,7 +290,7 @@ const coverType = useStorage('queue:cover-type', CoverType.COVER_ART)
|
||||||
class="discrete link album"
|
class="discrete link album"
|
||||||
:to="{name: 'library.albums.detail', params: {id: currentTrack.albumId }}"
|
:to="{name: 'library.albums.detail', params: {id: currentTrack.albumId }}"
|
||||||
>
|
>
|
||||||
{{ currentTrack.albumTitle }}
|
{{ currentTrack.albumTitle ?? $t('components.Queue.meta.unknownAlbum') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -188,7 +188,7 @@ const hideArtist = () => {
|
||||||
:to="{name: 'library.artists.detail', params: {id: currentTrack.artistId }}"
|
:to="{name: 'library.artists.detail', params: {id: currentTrack.artistId }}"
|
||||||
@click.stop.prevent=""
|
@click.stop.prevent=""
|
||||||
>
|
>
|
||||||
{{ currentTrack.artistName }}
|
{{ currentTrack.artistName ?? $t('components.audio.Player.meta.unknownArtist') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<template v-if="currentTrack.albumId !== -1">
|
<template v-if="currentTrack.albumId !== -1">
|
||||||
<span class="middle slash symbol" />
|
<span class="middle slash symbol" />
|
||||||
|
@ -197,7 +197,7 @@ const hideArtist = () => {
|
||||||
:to="{name: 'library.albums.detail', params: {id: currentTrack.albumId }}"
|
:to="{name: 'library.albums.detail', params: {id: currentTrack.albumId }}"
|
||||||
@click.stop.prevent=""
|
@click.stop.prevent=""
|
||||||
>
|
>
|
||||||
{{ currentTrack.albumTitle }}
|
{{ currentTrack.albumTitle ?? $t('components.audio.Player.meta.unknownAlbum') }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
@ -216,10 +216,10 @@ const hideArtist = () => {
|
||||||
{{ currentTrack.title }}
|
{{ currentTrack.title }}
|
||||||
</strong>
|
</strong>
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
{{ currentTrack.artistName }}
|
{{ currentTrack.artistName ?? $t('components.audio.Player.meta.unknownArtist') }}
|
||||||
<template v-if="currentTrack.albumId !== -1">
|
<template v-if="currentTrack.albumId !== -1">
|
||||||
<span class="middle slash symbol" />
|
<span class="middle slash symbol" />
|
||||||
{{ currentTrack.albumTitle }}
|
{{ currentTrack.albumTitle ?? $t('components.audio.Player.meta.unknownAlbum') }}
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { createGlobalState, useNow, useStorage, useTimeAgo, whenever } from '@vu
|
||||||
import { computed, ref, shallowReactive, watchEffect } from 'vue'
|
import { computed, ref, shallowReactive, watchEffect } from 'vue'
|
||||||
import { shuffle as shuffleArray, sum } from 'lodash-es'
|
import { shuffle as shuffleArray, sum } from 'lodash-es'
|
||||||
import { useClamp } from '@vueuse/math'
|
import { useClamp } from '@vueuse/math'
|
||||||
import { useI18n } from 'vue-i18n'
|
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
import { looping, LoopingMode, isPlaying } from '~/composables/audio/player'
|
import { looping, LoopingMode, isPlaying } from '~/composables/audio/player'
|
||||||
|
@ -25,8 +24,8 @@ export interface QueueTrackSource {
|
||||||
export interface QueueTrack {
|
export interface QueueTrack {
|
||||||
id: number
|
id: number
|
||||||
title: string
|
title: string
|
||||||
artistName: string
|
artistName?: string
|
||||||
albumTitle: string
|
albumTitle?: string
|
||||||
position?: number
|
position?: number
|
||||||
|
|
||||||
// TODO: Add urls for those
|
// TODO: Add urls for those
|
||||||
|
@ -99,9 +98,9 @@ export const currentTrack = computed(() => queue.value[currentIndex.value])
|
||||||
// Use Queue
|
// Use Queue
|
||||||
export const useQueue = createGlobalState(() => {
|
export const useQueue = createGlobalState(() => {
|
||||||
const { currentSound } = useTracks()
|
const { currentSound } = useTracks()
|
||||||
|
// const { t } = useI18n()
|
||||||
|
|
||||||
const createQueueTrack = async (track: Track): Promise<QueueTrack> => {
|
const createQueueTrack = async (track: Track): Promise<QueueTrack> => {
|
||||||
const { t } = useI18n()
|
|
||||||
const { default: store } = await import('~/store')
|
const { default: store } = await import('~/store')
|
||||||
|
|
||||||
if (track.uploads.length === 0) {
|
if (track.uploads.length === 0) {
|
||||||
|
@ -115,8 +114,8 @@ export const useQueue = createGlobalState(() => {
|
||||||
return {
|
return {
|
||||||
id: track.id,
|
id: track.id,
|
||||||
title: track.title,
|
title: track.title,
|
||||||
artistName: track.artist?.name ?? t('composables.audio.queue.unknownArtist'),
|
artistName: track.artist?.name,
|
||||||
albumTitle: track.album?.title ?? t('composables.audio.queue.unknownAlbum'),
|
albumTitle: track.album?.title,
|
||||||
position: track.position,
|
position: track.position,
|
||||||
artistId: track.artist?.id ?? -1,
|
artistId: track.artist?.id ?? -1,
|
||||||
albumId: track.album?.id ?? -1,
|
albumId: track.album?.id ?? -1,
|
||||||
|
|
|
@ -190,7 +190,9 @@
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"queuePosition": "Track {index} of {length}",
|
"queuePosition": "Track {index} of {length}",
|
||||||
"startTime": "00:00"
|
"startTime": "00:00",
|
||||||
|
"unknownArtist": "Unknown Artist",
|
||||||
|
"unknownAlbum": "Unknown Album"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"RemoteSearchForm": {
|
"RemoteSearchForm": {
|
||||||
|
@ -514,7 +516,9 @@
|
||||||
"player": "Audio player and controls"
|
"player": "Audio player and controls"
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"position": "{index} of {length}"
|
"position": "{index} of {length}",
|
||||||
|
"unknownArtist": "Unknown Artist",
|
||||||
|
"unknownAlbum": "Unknown Album"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Search": {
|
"Search": {
|
||||||
|
@ -2960,10 +2964,6 @@
|
||||||
"audio": {
|
"audio": {
|
||||||
"usePlayOptions": {
|
"usePlayOptions": {
|
||||||
"addToQueueMessage": "{n} tracks were added to your queue | {n} track was added to your queue | {n} tracks were added to your queue"
|
"addToQueueMessage": "{n} tracks were added to your queue | {n} track was added to your queue | {n} tracks were added to your queue"
|
||||||
},
|
|
||||||
"queue": {
|
|
||||||
"unknownArtist": "Unknown Artist",
|
|
||||||
"unknownAlbum": "Unknown Album"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"locale": {
|
"locale": {
|
||||||
|
|
Loading…
Reference in New Issue