2020-10-04 11:31:47 -04:00
|
|
|
<template>
|
2022-05-29 12:49:00 -04:00
|
|
|
<div
|
|
|
|
v-for="playlist in playlists"
|
|
|
|
:key="playlist.itemId"
|
2023-07-01 03:09:16 -04:00
|
|
|
class="media is-align-items-center"
|
2022-05-29 12:49:00 -04:00
|
|
|
@click="open_playlist(playlist.item)"
|
|
|
|
>
|
2023-06-10 13:22:29 -04:00
|
|
|
<figure class="media-left is-clickable">
|
2023-06-30 15:41:40 -04:00
|
|
|
<mdicon class="icon" :name="icon_name(playlist.item)" size="16" />
|
2022-02-19 01:47:54 -05:00
|
|
|
</figure>
|
2023-06-10 13:22:29 -04:00
|
|
|
<div class="media-content is-clickable is-clipped">
|
2022-05-20 07:44:22 -04:00
|
|
|
<h1 class="title is-6" v-text="playlist.item.name" />
|
2022-02-19 01:47:54 -05:00
|
|
|
</div>
|
|
|
|
<div class="media-right">
|
2022-04-16 14:21:26 -04:00
|
|
|
<a @click.prevent.stop="open_dialog(playlist.item)">
|
2023-06-30 15:41:40 -04:00
|
|
|
<mdicon class="icon has-text-dark" name="dots-vertical" size="16" />
|
2022-02-19 01:47:54 -05:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<teleport to="#app">
|
2022-05-29 12:49:00 -04:00
|
|
|
<modal-dialog-playlist
|
|
|
|
:show="show_details_modal"
|
|
|
|
:playlist="selected_playlist"
|
|
|
|
@close="show_details_modal = false"
|
|
|
|
/>
|
2022-02-19 01:47:54 -05:00
|
|
|
</teleport>
|
2020-10-04 11:31:47 -04:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-02-19 00:18:01 -05:00
|
|
|
import ModalDialogPlaylist from '@/components/ModalDialogPlaylist.vue'
|
2020-10-04 11:31:47 -04:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'ListPlaylists',
|
2022-02-19 01:47:54 -05:00
|
|
|
components: { ModalDialogPlaylist },
|
2020-10-04 11:31:47 -04:00
|
|
|
|
|
|
|
props: ['playlists'],
|
|
|
|
|
2022-02-19 00:39:14 -05:00
|
|
|
data() {
|
2020-10-04 11:31:47 -04:00
|
|
|
return {
|
|
|
|
show_details_modal: false,
|
|
|
|
selected_playlist: {}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2023-06-07 15:25:54 -04:00
|
|
|
open_playlist(playlist) {
|
2023-07-18 08:08:52 -04:00
|
|
|
if (playlist.type === 'folder') {
|
2023-07-10 09:37:40 -04:00
|
|
|
this.$router.push({
|
2023-07-18 08:08:52 -04:00
|
|
|
name: 'playlist-folder',
|
2023-07-10 09:37:40 -04:00
|
|
|
params: { id: playlist.id }
|
|
|
|
})
|
2020-10-04 11:31:47 -04:00
|
|
|
} else {
|
2023-07-18 08:08:52 -04:00
|
|
|
this.$router.push({
|
|
|
|
name: 'playlist',
|
|
|
|
params: { id: playlist.id }
|
|
|
|
})
|
2020-10-04 11:31:47 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2023-06-07 15:25:54 -04:00
|
|
|
open_dialog(playlist) {
|
2020-10-04 11:31:47 -04:00
|
|
|
this.selected_playlist = playlist
|
|
|
|
this.show_details_modal = true
|
2022-04-16 04:14:03 -04:00
|
|
|
},
|
|
|
|
|
2023-06-07 15:25:54 -04:00
|
|
|
icon_name(playlist) {
|
2022-04-16 04:14:03 -04:00
|
|
|
if (playlist.type === 'folder') {
|
|
|
|
return 'folder'
|
|
|
|
} else if (playlist.type === 'rss') {
|
|
|
|
return 'rss'
|
|
|
|
}
|
2023-11-24 09:48:29 -05:00
|
|
|
return 'music-box-multiple'
|
2020-10-04 11:31:47 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-02-19 00:39:14 -05:00
|
|
|
<style></style>
|