Skip to content

Commit

Permalink
fix: fix Add Item button on empty filenames list, update scene detail…
Browse files Browse the repository at this point in the history
…s after edit (xbapps#1480)

Co-authored-by: crwxaj <crwxaj>
  • Loading branch information
crwxaj authored Nov 6, 2023
1 parent 24325c7 commit 9e442c1
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions ui/src/views/scenes/EditScene.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ export default {
}
try {
scene.files = JSON.parse(scene.filenames_arr)
if (scene.files == null) {
scene.files = []
}
} catch {
scene.files = []
}
Expand Down Expand Up @@ -207,27 +210,11 @@ export default {
this.scene.filenames_arr = JSON.stringify(this.scene.files)
this.scene.duration = String(this.scene.duration) // force to a string, if no change the UI sends an int, otherwise a string, nust be constant
ky.post(`/api/scene/edit/${this.scene.id}`, { json: { ...this.scene } })
this.scene.cast = this.scene.castArray.map(a => {
const find = this.scene.cast.find(o => o.name === a)
if (find) return find
return {
name: a,
count: 0
}
})
this.scene.tags = this.scene.tagsArray.map(t => {
const find = this.scene.tags.find(o => o.name === t)
if (find) return find
return {
name: t,
count: 0
}
})
ky.post(`/api/scene/edit/${this.scene.id}`, { json: { ...this.scene } }).json().then(data => {
this.$store.commit('sceneList/updateScene', data)
this.$store.commit('overlay/showDetails', { scene: data })
})
this.$store.commit('sceneList/updateScene', this.scene)
this.changesMade = false
this.close()
Expand Down

0 comments on commit 9e442c1

Please sign in to comment.