|
|
@ -1,22 +1,26 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<a
|
|
|
|
<transition name="fade">
|
|
|
|
class="btn currentlyListening"
|
|
|
|
<a
|
|
|
|
href=" https://spot2gether.cybre.town/user/op3q884heqao7laioz05ebaoz"
|
|
|
|
class="btn currentlyListening"
|
|
|
|
target="_blank"
|
|
|
|
href=" https://spot2gether.cybre.town/user/op3q884heqao7laioz05ebaoz"
|
|
|
|
ref="noopener noreferrer"
|
|
|
|
target="_blank"
|
|
|
|
>
|
|
|
|
ref="noopener noreferrer"
|
|
|
|
<div v-if="currentlyPlaying?.item" class="row align-items-center">
|
|
|
|
v-if="currentlyPlaying?.item"
|
|
|
|
<i class="bi-music-note col-auto icon" />
|
|
|
|
>
|
|
|
|
<div class="col-auto d-flex flex-column text">
|
|
|
|
<div class="row align-items-center">
|
|
|
|
<b>{{ currentlyPlaying?.item?.name }}</b>
|
|
|
|
<i class="bi-music-note col-auto icon" />
|
|
|
|
<div>{{ currentlyPlaying?.item?.artists.map(artist => artist.name).join(', ') }}</div>
|
|
|
|
<div class="col-auto d-flex flex-column text">
|
|
|
|
|
|
|
|
<b>{{ currentlyPlaying?.item?.name }}</b>
|
|
|
|
|
|
|
|
<div>{{ currentlyPlaying?.item?.artists.map(artist => artist.name).join(', ') }}</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</transition>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
let updateMusicInfo = null;
|
|
|
|
let updateMusicInfo = null;
|
|
|
|
|
|
|
|
const noob = () => null;
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "CurrentlyListening",
|
|
|
|
name: "CurrentlyListening",
|
|
|
@ -31,10 +35,10 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async created() {
|
|
|
|
async created() {
|
|
|
|
this.currentlyPlaying = (await this.fetchMusicInfo())?.currentlyPlaying;
|
|
|
|
this.currentlyPlaying = (await this.fetchMusicInfo().catch(noob))?.currentlyPlaying;
|
|
|
|
updateMusicInfo = setInterval(async () => {
|
|
|
|
updateMusicInfo = setInterval(async () => {
|
|
|
|
this.currentlyPlaying = (await this.fetchMusicInfo())?.currentlyPlaying;
|
|
|
|
this.currentlyPlaying = (await this.fetchMusicInfo().catch(noob))?.currentlyPlaying;
|
|
|
|
}, 20000);
|
|
|
|
}, 10000);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
beforeDestroy() {
|
|
|
|
beforeDestroy() {
|
|
|
|
clearInterval(updateMusicInfo);
|
|
|
|
clearInterval(updateMusicInfo);
|
|
|
|