mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-03 00:06:46 +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">
|
<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">
|
<transition-group type="transition" :name="!drag ? 'playlist-item' : null">
|
||||||
<template v-for="(item, index) in itemsCopy">
|
<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>
|
</template>
|
||||||
</transition-group>
|
</transition-group>
|
||||||
</draggable>
|
</draggable>
|
||||||
@ -68,6 +68,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
draggableUpdate() {
|
||||||
var playlistUpdate = {
|
var playlistUpdate = {
|
||||||
items: this.itemsCopy.map((i) => ({ libraryItemId: i.libraryItemId, episodeId: i.episodeId }))
|
items: this.itemsCopy.map((i) => ({ libraryItemId: i.libraryItemId, episodeId: i.episodeId }))
|
||||||
|
@ -183,7 +183,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
clickEdit() {
|
clickEdit() {
|
||||||
// todo: edit
|
this.$emit('edit', this.item)
|
||||||
},
|
},
|
||||||
toggleFinished() {
|
toggleFinished() {
|
||||||
var updatePayload = {
|
var updatePayload = {
|
||||||
|
Loading…
Reference in New Issue
Block a user