koel/resources/assets/js/components/profile-preferences/SpotifyIntegration.vue
Phan An abb0438c8d
fix: buggy Spotify integration (#1731)
This fixes a bug with Spotify integration that occurs if an installation isn't connected to Last.fm. Closing #1730 and #1653.
2023-12-27 12:49:28 +01:00

45 lines
1.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<section class="text-secondary">
<h1>
<span class="spotify-icon">
<Icon :icon="faSpotify" />
</span>
Spotify Integration
</h1>
<div v-if="useSpotify">
<p>
Spotify integration is enabled.
Koel will attempt to retrieve album arts and artist images from Spotify when a song is played, if needed.
</p>
</div>
<div v-else>
<p>
Spotify integration is not enabled.
<span v-if="isAdmin" data-testid="spotify-admin-instruction">
Visit
<a href="https://docs.koel.dev/3rd-party.html#spotify" class="text-highlight" target="_blank">Koels Wiki</a>
for a quick how-to.
</span>
<span v-else data-testid="spotify-user-instruction">
Try politely asking an administrator to enable it.
</span>
</p>
</div>
</section>
</template>
<script lang="ts" setup>
import { faSpotify } from '@fortawesome/free-brands-svg-icons'
import { useAuthorization, useThirdPartyServices } from '@/composables';
const { currentUser, isAdmin } = useAuthorization();
const { useSpotify } = useThirdPartyServices();
</script>
<style scoped lang="scss">
.spotify-icon {
margin-right: .4rem;
color: #1db954; // Spotify green
}
</style>