diff --git a/pages/compilations/[id].vue b/pages/compilations/[id].vue
index f9f2ce9..4f83d9d 100644
--- a/pages/compilations/[id].vue
+++ b/pages/compilations/[id].vue
@@ -17,7 +17,7 @@
{{ track.title }}
- {{ store.getArtistById(track.artist).name }}
+ {{ getArtistName(track.artist) }}
@@ -35,9 +35,9 @@
{{ currentTrack.title }}
-
+
- {{ store.getArtistById(currentTrack.artist).name }}
+ {{ currentArtist.name }}
see artist page:
-
- {{ store.getArtistById(currentTrack.artist).name }}
+
+ {{ currentArtist.name }}
purchase the track:
@@ -71,19 +71,21 @@ const tracks = ref()
const mixPlayer = ref()
const videoSD = ref()
const currentTrack = ref()
-
-const currentArtist = computed(() => {
- currentTrack
-})
-
const { isLoaded } = storeToRefs(store)
+const currentArtist = computed(() => {
+ return store.getArtistById(currentTrack.value.artist)
+})
+const getArtistName = (id: number) => {
+ return store.getArtistById(id)?.name
+}
+
+// LOAD DATAs
onMounted(() => {
- loadCompilation()
+ loadCompilation() // if user arrive directly on compilation page
})
-
watch(isLoaded, () => {
- loadCompilation()
+ loadCompilation() // if the user came from another page
})
const watchPlayingTrack = () => {
@@ -99,9 +101,9 @@ const watchPlayingTrack = () => {
const loadCompilation = () => {
if (isLoaded.value) {
- compilation.value = store.getCompilationById(route.params.id)
- tracks.value = store.getTracksByCompilationId(route.params.id)
- videoSD.value = 'https://files.erudi.fr/evilspins/' + compilation.value.id + '-HD.mp4'
+ compilation.value = store.getCompilationById(route.params.id as string)
+ tracks.value = store.getTracksByCompilationId(route.params.id as string)
+ videoSD.value = 'https://files.erudi.fr/evilspins/' + compilation.value.id + '-SD.mp4'
mixPlayer.value.load()
mixPlayer.value.play()
mixPlayer.value.focus()
@@ -109,7 +111,7 @@ const loadCompilation = () => {
}
}
-const listenTo = (start) => {
+const listenTo = (start: number) => {
mixPlayer.value.currentTime = start
mixPlayer.value.play()
}
diff --git a/pages/index.vue b/pages/index.vue
index 0afdfa9..177f5fd 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -9,7 +9,7 @@
❓
-
Compilations
diff --git a/server/api/compilations.ts b/server/api/compilations.ts
index 9aec7fb..9198906 100644
--- a/server/api/compilations.ts
+++ b/server/api/compilations.ts
@@ -3,12 +3,14 @@ export default eventHandler(() => {
{
id: 'ES00A',
name: 'zero',
- duration: 2794
+ duration: 2794,
+ description: '...',
},
{
id: 'ES00B',
name: 'zero b-sides',
- duration: 2470
+ duration: 2470,
+ description: '...',
}
]
})
diff --git a/types/types.ts b/types/types.ts
index 8e9f5f5..a2acceb 100644
--- a/types/types.ts
+++ b/types/types.ts
@@ -4,6 +4,7 @@ export interface Compilation {
name: string
duration: number
tracks?: Track[]
+ description: string
}
export interface Artist {