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