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="{
|
2024-03-24 11:02:11 +01:00
|
|
|
'is-clickable': item.is_playable,
|
|
|
|
'fd-is-not-allowed': !item.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"
|
2024-03-24 11:02:11 +01:00
|
|
|
:class="{ 'has-text-grey-light': !item.is_playable }"
|
|
|
|
v-text="item.name"
|
2022-05-29 18:49:00 +02:00
|
|
|
/>
|
|
|
|
<h2
|
2024-03-25 14:00:42 +01:00
|
|
|
class="subtitle is-7 has-text-weight-bold"
|
2022-05-29 18:49:00 +02:00
|
|
|
:class="{
|
2024-03-24 11:02:11 +01:00
|
|
|
'has-text-grey': item.is_playable,
|
|
|
|
'has-text-grey-light': !item.is_playable
|
2022-05-29 18:49:00 +02:00
|
|
|
}"
|
2024-03-24 11:02:11 +01:00
|
|
|
v-text="item.artists[0].name"
|
2023-06-07 15:06:02 +02:00
|
|
|
/>
|
2024-03-25 14:00:42 +01:00
|
|
|
<h2 class="subtitle is-7 has-text-grey" v-text="item.album.name" />
|
2024-03-24 11:02:11 +01:00
|
|
|
<h2 v-if="!item.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
|
2024-03-24 11:02:11 +01:00
|
|
|
v-if="item.restrictions && item.restrictions.reason"
|
2022-05-29 18:49:00 +02:00
|
|
|
v-text="
|
|
|
|
$t('list.spotify.restriction-reason', {
|
2024-03-24 11:02:11 +01:00
|
|
|
reason: item.restrictions.reason
|
2022-05-29 18:49:00 +02:00
|
|
|
})
|
|
|
|
"
|
|
|
|
/>)
|
2021-12-26 19:49:23 +01:00
|
|
|
</h2>
|
2018-08-11 07:47:10 +02:00
|
|
|
</div>
|
|
|
|
<div class="media-right">
|
2024-03-25 14:00:42 +01:00
|
|
|
<a @click.prevent.stop="show_details_modal = true">
|
|
|
|
<mdicon class="icon has-text-dark" name="dots-vertical" size="16" />
|
|
|
|
</a>
|
2018-08-11 07:47:10 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-03-25 14:00:42 +01:00
|
|
|
<teleport to="#app">
|
|
|
|
<modal-dialog-track-spotify
|
|
|
|
:show="show_details_modal"
|
|
|
|
:track="item"
|
|
|
|
@close="show_details_modal = false"
|
|
|
|
/>
|
|
|
|
</teleport>
|
2018-08-11 07:47:10 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2024-03-25 14:00:42 +01:00
|
|
|
import ModalDialogTrackSpotify from '@/components/ModalDialogTrackSpotify.vue'
|
2018-08-11 07:47:10 +02:00
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
|
|
|
export default {
|
2023-07-18 15:19:24 +02:00
|
|
|
name: 'ListItemTrackSpotify',
|
2024-03-25 14:00:42 +01:00
|
|
|
components: { ModalDialogTrackSpotify },
|
2024-02-28 13:10:08 +01:00
|
|
|
props: {
|
|
|
|
context_uri: { required: true, type: String },
|
2024-03-24 11:02:11 +01:00
|
|
|
item: { required: true, type: Object },
|
|
|
|
position: { required: true, type: Number }
|
2024-02-28 13:10:08 +01:00
|
|
|
},
|
2024-03-25 14:00:42 +01:00
|
|
|
data() {
|
|
|
|
return { show_details_modal: false }
|
|
|
|
},
|
2018-08-11 07:47:10 +02:00
|
|
|
methods: {
|
2023-06-07 21:25:54 +02:00
|
|
|
play() {
|
2024-03-24 11:02:11 +01:00
|
|
|
if (this.item.is_playable) {
|
2023-06-10 18:25:12 +02:00
|
|
|
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>
|