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