diff --git a/client/components/modals/libraries/LibraryItem.vue b/client/components/modals/libraries/LibraryItem.vue index 60839c3b..37c1d692 100644 --- a/client/components/modals/libraries/LibraryItem.vue +++ b/client/components/modals/libraries/LibraryItem.vue @@ -59,9 +59,6 @@ export default { } }, methods: { - itemClicked() { - // this.$emit('click', this.library) - }, editClick() { this.$emit('edit', this.library) }, @@ -69,7 +66,7 @@ export default { this.$root.socket.emit('scan', this.library.id) }, forceScan() { - this.$root.socket.emit('scan', this.library.id, {forceRescan: true}) + this.$root.socket.emit('scan', this.library.id, { forceRescan: true }) }, deleteClick() { if (this.isMain) return diff --git a/client/components/tables/LibrariesTable.vue b/client/components/tables/LibrariesTable.vue index f9911398..9df5e66c 100644 --- a/client/components/tables/LibrariesTable.vue +++ b/client/components/tables/LibrariesTable.vue @@ -6,12 +6,12 @@ add - - + - @@ -48,6 +48,9 @@ export default { }, libraries() { return this.$store.getters['libraries/getSortedLibraries']() + }, + libraryScans() { + return this.$store.state.scanners.libraryScans } }, methods: { @@ -55,10 +58,9 @@ export default { this.drag = true clearTimeout(this.orderTimeout) }, - endDrag() { + endDrag(e) { this.drag = false this.checkOrder() - console.log('DRAG END') }, checkOrder() { clearTimeout(this.orderTimeout) @@ -78,7 +80,7 @@ export default { }) var newOrder = libraryOrderData.map((lib) => lib.id).join(',') if (currOrder !== newOrder) { - this.$axios.$patch('/api/libraries/order', libraryOrderData).then((libraries) => { + this.$axios.$post('/api/libraries/order', libraryOrderData).then((libraries) => { if (libraries && libraries.length) { this.$toast.success('Library order saved', { timeout: 1500 }) this.$store.commit('libraries/set', libraries) diff --git a/client/store/libraries.js b/client/store/libraries.js index 48793985..c4a51a2e 100644 --- a/client/store/libraries.js +++ b/client/store/libraries.js @@ -210,7 +210,7 @@ export const mutations = { } if (audiobook.book.genres && audiobook.book.genres.length) { audiobook.book.genres.forEach((genre) => { - if (tag && !state.filterData.genres.includes(genre)) state.filterData.genres.push(genre) + if (genre && !state.filterData.genres.includes(genre)) state.filterData.genres.push(genre) }) } } diff --git a/server/ApiController.js b/server/ApiController.js index c23a787e..1ce4f188 100644 --- a/server/ApiController.js +++ b/server/ApiController.js @@ -63,7 +63,8 @@ class ApiController { this.router.get('/libraries/:id/search', LibraryController.middleware.bind(this), LibraryController.search.bind(this)) this.router.get('/libraries/:id/stats', LibraryController.middleware.bind(this), LibraryController.stats.bind(this)) this.router.get('/libraries/:id/authors', LibraryController.middleware.bind(this), LibraryController.getAuthors.bind(this)) - this.router.patch('/libraries/order', LibraryController.reorder.bind(this)) + this.router.post('/libraries/order', LibraryController.reorder.bind(this)) + // TEMP: Support old syntax for mobile app this.router.get('/library/:id/audiobooks', LibraryController.middleware.bind(this), LibraryController.getBooksForLibrary.bind(this))