2021-11-10 01:46:30 +00:00
|
|
|
import * as Vue from "vue";
|
|
|
|
|
|
|
|
let component: Vue.Component = {
|
|
|
|
props: ['track', 'episode'],
|
|
|
|
computed: {
|
|
|
|
IsTrackPlaying() {
|
|
|
|
return this.track !== null && this.track !== undefined;
|
|
|
|
},
|
|
|
|
IsEpisodePlaying() {
|
|
|
|
return this.episode !== null && this.episode !== undefined;
|
2022-06-18 10:56:34 +01:00
|
|
|
},
|
|
|
|
ImageUrl() {
|
|
|
|
if(this.track.album.images.length > 0)
|
|
|
|
{
|
|
|
|
return this.track.album.images[0].url;
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
return "";
|
|
|
|
}
|
2021-11-10 01:46:30 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
template:
|
|
|
|
`
|
|
|
|
<div class="card now-playing-card" v-if="IsTrackPlaying">
|
2022-06-18 10:56:34 +01:00
|
|
|
<img :src="ImageUrl" class="cover-art">
|
2021-11-10 01:46:30 +00:00
|
|
|
<h4>{{ track.name }}</h4>
|
|
|
|
<h6>
|
|
|
|
{{ track.album.name }}
|
|
|
|
</h6>
|
|
|
|
<h6>
|
|
|
|
<template v-for="(artist, index) in track.artists">
|
|
|
|
<template v-if="index > 0">, </template>
|
|
|
|
<span>{{ artist.name }}</span>
|
|
|
|
</template>
|
|
|
|
</h6>
|
2021-11-10 09:15:39 +00:00
|
|
|
<div style="width: 100%">
|
|
|
|
<spotify-logo :link="track.externalUrls.spotify" style="float: left" />
|
|
|
|
<img src="/live.gif" style="height: 20px; float: right">
|
|
|
|
</div>
|
2021-11-10 01:46:30 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card now-playing-card" v-else-if="IsEpisodePlaying">
|
|
|
|
<img :src="episode.show.images[0].url" class="cover-art">
|
|
|
|
<h4>{{ episode.name }}</h4>
|
|
|
|
<h6>
|
|
|
|
{{ episode.show.name }}
|
|
|
|
</h6>
|
|
|
|
<h6>
|
|
|
|
{{ episode.show.publisher }}
|
|
|
|
</h6>
|
2021-11-10 09:15:39 +00:00
|
|
|
<div style="width: 100%">
|
|
|
|
<spotify-logo :link="episode.externalUrls.spotify" style="float: left" />
|
|
|
|
<img src="/live.gif" style="height: 20px; float: right">
|
|
|
|
</div>
|
2021-11-10 01:46:30 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card now-playing-card" v-else>
|
|
|
|
<h4>No Playback</h4>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
}
|
|
|
|
|
|
|
|
export default component;
|