From f752c19418672b10e2168bddbcd6a8612cccef4d Mon Sep 17 00:00:00 2001 From: advplyr Date: Wed, 6 Oct 2021 21:08:52 -0500 Subject: [PATCH] narrator filter, no series filter, full paths toggle, book landing page details, new sans font, update query string on filter/sort, persist experimental feature flag, batch edit redirect bug, upload file permissions and owner --- client/assets/app.css | 4 +- client/components/app/Appbar.vue | 2 +- client/components/app/BookShelf.vue | 52 +++++++-- client/components/app/BookShelfToolbar.vue | 2 +- client/components/controls/FilterSelect.vue | 13 +++ .../components/modals/edit-tabs/Details.vue | 6 +- client/components/modals/edit-tabs/Tracks.vue | 18 +-- .../modals/libraries/EditLibrary.vue | 19 +++- .../modals/libraries/FolderChooser.vue | 7 +- client/components/tables/OtherFilesTable.vue | 14 ++- client/components/tables/TracksTable.vue | 19 ++-- client/components/ui/Btn.vue | 3 + client/components/ui/Dropdown.vue | 2 +- client/components/ui/TextInput.vue | 13 ++- client/layouts/default.vue | 6 + client/nuxt.config.js | 2 +- client/package.json | 2 +- client/pages/account.vue | 2 +- client/pages/audiobook/_id/index.vue | 103 +++++++++++++++--- client/pages/batch/index.vue | 7 +- client/pages/config/index.vue | 67 ++---------- client/store/audiobooks.js | 22 +++- client/store/index.js | 23 +--- client/store/user.js | 3 - client/tailwind.config.js | 2 +- docker-template.xml | 15 ++- index.js | 4 +- package.json | 2 +- prod.js | 4 +- server/Scanner.js | 92 ++++++++-------- server/Server.js | 35 +++--- server/objects/Audiobook.js | 8 +- server/objects/Book.js | 12 +- server/utils/filePerms.js | 85 +++++++++++++++ server/utils/fileUtils.js | 12 +- server/utils/nfoGenerator.js | 2 +- 36 files changed, 454 insertions(+), 230 deletions(-) create mode 100644 server/utils/filePerms.js diff --git a/client/assets/app.css b/client/assets/app.css index a03d64f8..a2de2393 100644 --- a/client/assets/app.css +++ b/client/assets/app.css @@ -66,10 +66,10 @@ background-color: #474747; } .tracksTable td { - padding: 4px; + padding: 4px 8px; } .tracksTable th { - padding: 4px; + padding: 4px 8px; font-size: 0.75rem; } diff --git a/client/components/app/Appbar.vue b/client/components/app/Appbar.vue index e6bc3b4f..594c3e79 100644 --- a/client/components/app/Appbar.vue +++ b/client/components/app/Appbar.vue @@ -23,7 +23,7 @@ -

{{ libraryName }}

+

{{ libraryName }}

diff --git a/client/components/app/BookShelf.vue b/client/components/app/BookShelf.vue index 62ebf1f1..1ca96bef 100644 --- a/client/components/app/BookShelf.vue +++ b/client/components/app/BookShelf.vue @@ -53,7 +53,7 @@ export default { data() { return { shelves: [], - currFilterOrderKey: null, + currSearchParams: null, availableSizes: [60, 80, 100, 120, 140, 160, 180, 200, 220], selectedSizeIndex: 3, rowPaddingX: 40, @@ -89,9 +89,6 @@ export default { audiobooks() { return this.$store.state.audiobooks.audiobooks }, - filterOrderKey() { - return this.$store.getters['user/getFilterOrderKey'] - }, bookCoverWidth() { return this.availableSizes[this.selectedSizeIndex] }, @@ -111,6 +108,12 @@ export default { filterBy() { return this.$store.getters['user/getUserSetting']('filterBy') }, + orderBy() { + return this.$store.getters['user/getUserSetting']('orderBy') + }, + orderDesc() { + return this.$store.getters['user/getUserSetting']('orderDesc') + }, showGroups() { return this.page !== '' && this.page !== 'search' && !this.selectedSeries }, @@ -165,6 +168,8 @@ export default { var booksPerRow = Math.floor(width / this.bookWidth) + this.currSearchParams = this.buildSearchParams() + var entities = this.entities var groups = [] var currentRow = 0 @@ -185,6 +190,8 @@ export default { this.shelves = groups }, async init() { + this.checkUpdateSearchParams() + this.wrapperClientWidth = this.$refs.wrapper ? this.$refs.wrapper.clientWidth : 0 var bookshelfCoverSize = this.$store.getters['user/getUserSetting']('bookshelfCoverSize') @@ -203,10 +210,41 @@ export default { console.log('[AudioBookshelf] Audiobooks Updated') this.setBookshelfEntities() }, - settingsUpdated(settings) { - if (this.currFilterOrderKey !== this.filterOrderKey) { - this.setBookshelfEntities() + buildSearchParams() { + if (this.page === 'search' || this.page === 'series') { + return '' } + + let searchParams = new URLSearchParams() + if (this.filterBy && this.filterBy !== 'all') { + searchParams.set('filter', this.filterBy) + } + if (this.orderBy) { + searchParams.set('order', this.orderBy) + searchParams.set('orderdesc', this.orderDesc ? 1 : 0) + } + return searchParams.toString() + }, + checkUpdateSearchParams() { + var newSearchParams = this.buildSearchParams() + var currentQueryString = window.location.search + + if (newSearchParams === '') { + return false + } + + if (newSearchParams !== this.currSearchParams || newSearchParams !== currentQueryString) { + let newurl = window.location.protocol + '//' + window.location.host + window.location.pathname + '?' + newSearchParams + window.history.replaceState({ path: newurl }, '', newurl) + return true + } + + return false + }, + settingsUpdated(settings) { + var wasUpdated = this.checkUpdateSearchParams() + if (wasUpdated) this.setBookshelfEntities() + if (settings.bookshelfCoverSize !== this.bookCoverWidth && settings.bookshelfCoverSize !== undefined) { var index = this.availableSizes.indexOf(settings.bookshelfCoverSize) if (index >= 0) { diff --git a/client/components/app/BookShelfToolbar.vue b/client/components/app/BookShelfToolbar.vue index c9dcbed9..637746e1 100644 --- a/client/components/app/BookShelfToolbar.vue +++ b/client/components/app/BookShelfToolbar.vue @@ -14,7 +14,7 @@
- + diff --git a/client/components/controls/FilterSelect.vue b/client/components/controls/FilterSelect.vue index 828b94a5..a39a7f09 100644 --- a/client/components/controls/FilterSelect.vue +++ b/client/components/controls/FilterSelect.vue @@ -41,6 +41,11 @@ No {{ sublist }}
+
  • +
    + No Series +
    +