From 7a3f47d61001fd85e1421b32f781c429e8f1cc62 Mon Sep 17 00:00:00 2001 From: mwinter Date: Thu, 29 Jun 2023 02:11:34 +0200 Subject: [PATCH] clicking a score button now loads the soundcloud track if there is one --- portfolio-nuxt/components/IconButton.vue | 6 +++++- portfolio-nuxt/layouts/default.vue | 18 +++++++++++++++++- portfolio-nuxt/pages/[files]/[filename].vue | 14 +++++++++----- portfolio-nuxt/pages/index.vue | 2 +- portfolio-nuxt/stores/AudioPlayerStore.js | 7 ++++++- 5 files changed, 38 insertions(+), 9 deletions(-) diff --git a/portfolio-nuxt/components/IconButton.vue b/portfolio-nuxt/components/IconButton.vue index de1efd3..d61ea9e 100644 --- a/portfolio-nuxt/components/IconButton.vue +++ b/portfolio-nuxt/components/IconButton.vue @@ -2,7 +2,11 @@
- + + + + + diff --git a/portfolio-nuxt/layouts/default.vue b/portfolio-nuxt/layouts/default.vue index cc1a65d..505dc05 100644 --- a/portfolio-nuxt/layouts/default.vue +++ b/portfolio-nuxt/layouts/default.vue @@ -16,7 +16,7 @@
-
@@ -35,4 +35,20 @@ const audioPlayerStore = useAudioPlayerStore() const modalStore = useModalStore() + const route = useRoute() + + if(route.params.files == 'scores') { + const { data: work } = await useFetch('https://unboundedpress.org/api/works?filter={"score":"' + route.params.filename + '"}', { + transform: (work) => { + + if(work[0].soundcloud_trackid){ + audioPlayerStore.setSoundCloudTrackID(work[0].soundcloud_trackid) + } else { + audioPlayerStore.clearSoundCloudTrackID() + } + return work[0] + } + }) + } + diff --git a/portfolio-nuxt/pages/[files]/[filename].vue b/portfolio-nuxt/pages/[files]/[filename].vue index 998d115..e2e7e8d 100644 --- a/portfolio-nuxt/pages/[files]/[filename].vue +++ b/portfolio-nuxt/pages/[files]/[filename].vue @@ -1,19 +1,23 @@