mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Update:Handle edit playlist item
This commit is contained in:
parent
531f947754
commit
a217ed5574
@ -12,7 +12,7 @@
|
||||
<draggable v-model="itemsCopy" v-bind="dragOptions" class="list-group" handle=".drag-handle" draggable=".item" tag="div" @start="drag = true" @end="drag = false" @update="draggableUpdate">
|
||||
<transition-group type="transition" :name="!drag ? 'playlist-item' : null">
|
||||
<template v-for="(item, index) in itemsCopy">
|
||||
<tables-playlist-item-table-row :key="index" :is-dragging="drag" :item="item" :playlist-id="playlistId" :book-cover-aspect-ratio="bookCoverAspectRatio" class="item" :class="drag ? '' : 'playlist-item-item'" />
|
||||
<tables-playlist-item-table-row :key="index" :is-dragging="drag" :item="item" :playlist-id="playlistId" :book-cover-aspect-ratio="bookCoverAspectRatio" class="item" :class="drag ? '' : 'playlist-item-item'" @edit="editItem" />
|
||||
</template>
|
||||
</transition-group>
|
||||
</draggable>
|
||||
@ -68,6 +68,16 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
editItem(playlistItem) {
|
||||
if (playlistItem.episode) {
|
||||
this.$store.commit('globals/setSelectedEpisode', playlist.episode)
|
||||
this.$store.commit('globals/setShowEditPodcastEpisodeModal', true)
|
||||
} else {
|
||||
const itemIds = this.items.map((i) => i.libraryItemId)
|
||||
this.$store.commit('setBookshelfBookIds', itemIds)
|
||||
this.$store.commit('showEditModal', playlistItem.libraryItem)
|
||||
}
|
||||
},
|
||||
draggableUpdate() {
|
||||
var playlistUpdate = {
|
||||
items: this.itemsCopy.map((i) => ({ libraryItemId: i.libraryItemId, episodeId: i.episodeId }))
|
||||
|
@ -183,7 +183,7 @@ export default {
|
||||
})
|
||||
},
|
||||
clickEdit() {
|
||||
// todo: edit
|
||||
this.$emit('edit', this.item)
|
||||
},
|
||||
toggleFinished() {
|
||||
var updatePayload = {
|
||||
|
Loading…
Reference in New Issue
Block a user