[web] Fix unresponsive Spotify music page #1917

This commit is contained in:
Alain Nussbaumer
2025-09-11 09:40:01 +10:00
parent 82c8374cad
commit 15fd59b2a1
5 changed files with 341 additions and 357 deletions

View File

@@ -16,9 +16,13 @@ export default {
},
spotify() {
return api.get('./api/spotify').then((configuration) => {
const sdk = SpotifyApi.withAccessToken(configuration.webapi_client_id, {
access_token: configuration.webapi_token
})
const sdk = SpotifyApi.withAccessToken(
configuration.webapi_client_id,
{
access_token: configuration.webapi_token
},
{ errorHandler: { handleErrors: () => true } }
)
return { api: sdk, configuration }
})
}

View File

@@ -56,7 +56,10 @@ export default {
<style scoped>
.card-content {
max-height: calc(100vh - var(--bulma-modal-content-spacing-tablet) - calc(4 * var(--bulma-navbar-height)));
max-height: calc(
100vh - var(--bulma-modal-content-spacing-tablet) -
calc(4 * var(--bulma-navbar-height))
);
overflow: auto;
}
.fade-leave-active {

View File

@@ -1,6 +1,6 @@
<template>
<tabs-music />
<content-with-heading>
<content-with-heading v-if="albums">
<template #heading>
<pane-title :content="{ title: $t('page.spotify.music.new-releases') }" />
</template>
@@ -16,7 +16,7 @@
</router-link>
</template>
</content-with-heading>
<content-with-heading>
<content-with-heading v-if="playlists">
<template #heading>
<pane-title
:content="{ title: $t('page.spotify.music.featured-playlists') }"
@@ -34,7 +34,7 @@
</router-link>
</template>
</content-with-heading>
<content-with-heading>
<content-with-heading v-if="artists">
<template #heading>
<pane-title
:content="{ title: $t('page.spotify.music.followed-artists') }"
@@ -84,11 +84,11 @@ export default {
null,
3
)
]).then((response) => {
]).then(([newReleases, followedArtists, featuredPlaylists]) => {
next((vm) => {
vm.albums = response[0].albums.items
vm.artists = response[1].artists.items
vm.playlists = response[2].playlists.items
vm.albums = newReleases.albums.items
vm.artists = followedArtists?.artists.items
vm.playlists = featuredPlaylists.playlists.items
})
})
})