add coverid
This commit is contained in:
@@ -1,14 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="hidden tools fixed top-0 -left-0">
|
||||
<div class="z-50 tools fixed top-0 -left-0 hidden">
|
||||
<button @click="setDisplay('pile')">pile</button>
|
||||
<button @click="setDisplay('plateau')">plateau</button>
|
||||
<button @click="setDisplay('holdem')">holdem</button>
|
||||
</div>
|
||||
<div ref="deck" class="deck flex flex-wrap justify-center gap-4">
|
||||
<card v-if="compilation.duration" v-for="track in dataStore.getTracksByCompilationId(compilation.id)"
|
||||
:key="track.id" :track="track" />
|
||||
<card v-else v-for="track in dataStore.getPlaylistTracksByCompilationId(compilation.id)" :track="track" />
|
||||
<card v-for="track in tracks" :key="track.id" :track="track" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -22,6 +20,7 @@ const props = defineProps<{
|
||||
}>()
|
||||
const dataStore = useDataStore()
|
||||
const deck = ref()
|
||||
const tracks = props.compilation.duration ? dataStore.getTracksByCompilationId(props.compilation.id) : dataStore.getPlaylistTracksByCompilationId(props.compilation.id)
|
||||
|
||||
function setDisplay(displayMode) {
|
||||
deck.value.classList.remove('pile', 'plateau', 'holdem')
|
||||
|
||||
@@ -43,6 +43,7 @@ export default eventHandler(async (event) => {
|
||||
const date = new Date(year, month - 1, day, hour)
|
||||
const card = getCardFromDate(date)
|
||||
const url = `${urlPrefix}/${encodeURIComponent(file)}`
|
||||
const coverId = `${urlPrefix}/cover/${encodeURIComponent(file)}`
|
||||
|
||||
return {
|
||||
id: Number(`${year}${index + 1}`),
|
||||
@@ -51,7 +52,7 @@ export default eventHandler(async (event) => {
|
||||
title: title.trim(),
|
||||
artist: artist.trim(),
|
||||
url,
|
||||
coverId: '',
|
||||
coverId,
|
||||
card
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user