2018-08-11 01:47:10 -04:00
|
|
|
<template>
|
2023-07-01 03:09:16 -04:00
|
|
|
<div
|
|
|
|
v-if="is_next || !show_only_next_items"
|
|
|
|
class="media is-align-items-center"
|
|
|
|
>
|
2022-02-19 00:39:14 -05:00
|
|
|
<div v-if="edit_mode" class="media-left">
|
2023-06-30 15:41:40 -04:00
|
|
|
<mdicon
|
|
|
|
class="icon has-text-grey fd-is-movable handle"
|
|
|
|
name="drag-horizontal"
|
|
|
|
size="16"
|
|
|
|
/>
|
2018-08-11 01:47:10 -04:00
|
|
|
</div>
|
2023-06-10 13:22:29 -04:00
|
|
|
<div class="media-content is-clickable is-clipped" @click="play">
|
2022-05-29 12:49:00 -04:00
|
|
|
<h1
|
|
|
|
class="title is-6"
|
|
|
|
:class="{
|
|
|
|
'has-text-primary': item.id === state.item_id,
|
|
|
|
'has-text-grey-light': !is_next
|
|
|
|
}"
|
|
|
|
v-text="item.title"
|
|
|
|
/>
|
|
|
|
<h2
|
|
|
|
class="subtitle is-7"
|
|
|
|
:class="{
|
|
|
|
'has-text-primary': item.id === state.item_id,
|
|
|
|
'has-text-grey-light': !is_next,
|
|
|
|
'has-text-grey': is_next && item.id !== state.item_id
|
|
|
|
}"
|
|
|
|
>
|
2022-05-20 07:44:22 -04:00
|
|
|
<b v-text="item.artist" />
|
2022-02-19 00:39:14 -05:00
|
|
|
</h2>
|
2022-05-29 12:49:00 -04:00
|
|
|
<h2
|
|
|
|
class="subtitle is-7"
|
|
|
|
:class="{
|
|
|
|
'has-text-primary': item.id === state.item_id,
|
|
|
|
'has-text-grey-light': !is_next,
|
|
|
|
'has-text-grey': is_next && item.id !== state.item_id
|
|
|
|
}"
|
|
|
|
v-text="item.album"
|
|
|
|
/>
|
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 {
|
2018-12-15 03:56:09 -05:00
|
|
|
name: 'ListItemQueueItem',
|
2022-02-19 00:39:14 -05:00
|
|
|
props: [
|
|
|
|
'item',
|
|
|
|
'position',
|
|
|
|
'current_position',
|
|
|
|
'show_only_next_items',
|
|
|
|
'edit_mode'
|
|
|
|
],
|
2018-08-11 01:47:10 -04:00
|
|
|
|
|
|
|
computed: {
|
2022-02-19 00:39:14 -05:00
|
|
|
state() {
|
2018-08-11 01:47:10 -04:00
|
|
|
return this.$store.state.player
|
|
|
|
},
|
|
|
|
|
2022-02-19 00:39:14 -05:00
|
|
|
is_next() {
|
2018-08-11 01:47:10 -04:00
|
|
|
return this.current_position < 0 || this.position >= this.current_position
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2023-06-07 15:25:54 -04:00
|
|
|
play() {
|
2020-04-11 13:43:53 -04:00
|
|
|
webapi.player_play({ item_id: this.item.id })
|
2018-08-11 01:47:10 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-02-19 00:39:14 -05:00
|
|
|
<style></style>
|