2018-08-11 01:47:10 -04:00
|
|
|
<template>
|
2023-07-01 03:09:16 -04:00
|
|
|
<div class="media is-align-items-center">
|
2023-06-10 12:25:12 -04:00
|
|
|
<div
|
|
|
|
class="media-content is-clipped"
|
|
|
|
:class="{
|
2023-06-10 13:22:29 -04:00
|
|
|
'is-clickable': track.is_playable,
|
|
|
|
'fd-is-not-allowed': !track.is_playable
|
2023-06-10 12:25:12 -04:00
|
|
|
}"
|
|
|
|
@click="play"
|
|
|
|
>
|
2022-05-29 12:49:00 -04:00
|
|
|
<h1
|
|
|
|
class="title is-6"
|
2023-06-07 09:06:02 -04:00
|
|
|
:class="{ 'has-text-grey-light': !track.is_playable }"
|
2022-05-29 12:49:00 -04:00
|
|
|
v-text="track.name"
|
|
|
|
/>
|
|
|
|
<h2
|
|
|
|
class="subtitle is-7"
|
|
|
|
:class="{
|
|
|
|
'has-text-grey': track.is_playable,
|
2023-06-07 09:06:02 -04:00
|
|
|
'has-text-grey-light': !track.is_playable
|
2022-05-29 12:49:00 -04:00
|
|
|
}"
|
2023-06-07 09:06:02 -04:00
|
|
|
v-text="track.artists[0].name"
|
|
|
|
/>
|
|
|
|
<h2 v-if="!track.is_playable" class="subtitle is-7">
|
2022-05-20 07:44:22 -04:00
|
|
|
(<span v-text="$t('list.spotify.not-playable-track')" />
|
2022-05-29 12:49:00 -04:00
|
|
|
<span
|
|
|
|
v-if="track.restrictions && track.restrictions.reason"
|
|
|
|
v-text="
|
|
|
|
$t('list.spotify.restriction-reason', {
|
|
|
|
reason: track.restrictions.reason
|
|
|
|
})
|
|
|
|
"
|
|
|
|
/>)
|
2021-12-26 13:49:23 -05:00
|
|
|
</h2>
|
2018-08-11 01:47:10 -04:00
|
|
|
</div>
|
|
|
|
<div class="media-right">
|
2022-02-19 00:39:14 -05:00
|
|
|
<slot name="actions" />
|
2018-08-11 01:47:10 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'SpotifyListItemTrack',
|
2023-06-10 12:25:12 -04:00
|
|
|
props: ['track', 'position', 'context_uri'],
|
2018-08-11 01:47:10 -04:00
|
|
|
methods: {
|
2023-06-07 15:25:54 -04:00
|
|
|
play() {
|
2023-06-10 12:25:12 -04:00
|
|
|
if (this.track.is_playable) {
|
|
|
|
webapi.player_play_uri(this.context_uri, false, this.position)
|
|
|
|
}
|
2018-08-11 01:47:10 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-02-19 00:39:14 -05:00
|
|
|
<style></style>
|