diff --git a/client/components/app/Appbar.vue b/client/components/app/Appbar.vue index 5bff062e..90689ae9 100644 --- a/client/components/app/Appbar.vue +++ b/client/components/app/Appbar.vue @@ -175,8 +175,8 @@ export default { }) }, batchDeleteClick() { - var audiobookText = this.numLibraryItemsSelected > 1 ? `these ${this.numLibraryItemsSelected} audiobooks` : 'this audiobook' - var confirmMsg = `Are you sure you want to remove ${audiobookText}?\n\n*Does not delete your files, only removes the audiobooks from AudioBookshelf` + var audiobookText = this.numLibraryItemsSelected > 1 ? `these ${this.numLibraryItemsSelected} items` : 'this item' + var confirmMsg = `Are you sure you want to remove ${audiobookText}?\n\n*Does not delete your files, only removes the items from Audiobookshelf` if (confirm(confirmMsg)) { this.processingBatchDelete = true this.$store.commit('setProcessingBatch', true) diff --git a/client/components/app/LazyBookshelf.vue b/client/components/app/LazyBookshelf.vue index f4d00acd..920758f0 100644 --- a/client/components/app/LazyBookshelf.vue +++ b/client/components/app/LazyBookshelf.vue @@ -300,11 +300,11 @@ export default { var firstBookPage = Math.floor(firstBookIndex / this.booksPerFetch) var lastBookPage = Math.floor(lastBookIndex / this.booksPerFetch) if (!this.pagesLoaded[firstBookPage]) { - console.log('Must load next batch', firstBookPage, 'book index', firstBookIndex) + // console.log('Must load next batch', firstBookPage, 'book index', firstBookIndex) this.loadPage(firstBookPage) } if (!this.pagesLoaded[lastBookPage]) { - console.log('Must load last next batch', lastBookPage, 'book index', lastBookIndex) + // console.log('Must load last next batch', lastBookPage, 'book index', lastBookIndex) this.loadPage(lastBookPage) } diff --git a/client/components/app/StreamContainer.vue b/client/components/app/StreamContainer.vue index 45fd7c56..6398234f 100644 --- a/client/components/app/StreamContainer.vue +++ b/client/components/app/StreamContainer.vue @@ -95,16 +95,17 @@ export default { user() { return this.$store.state.user.user }, - userAudiobook() { + userLibraryItemProgress() { if (!this.libraryItemId) return return this.$store.getters['user/getUserLibraryItemProgress'](this.libraryItemId) }, - userAudiobookCurrentTime() { - return this.userAudiobook ? this.userAudiobook.currentTime || 0 : 0 + userItemCurrentTime() { + return this.userLibraryItemProgress ? this.userLibraryItemProgress.currentTime || 0 : 0 }, bookmarks() { - if (!this.userAudiobook) return [] - return (this.userAudiobook.bookmarks || []).map((bm) => ({ ...bm })).sort((a, b) => a.time - b.time) + return [] + // if (!this.userAudiobook) return [] + // return (this.userAudiobook.bookmarks || []).map((bm) => ({ ...bm })).sort((a, b) => a.time - b.time) }, streamLibraryItem() { return this.$store.state.streamLibraryItem @@ -236,9 +237,9 @@ export default { console.error('No Audio Ref') } }, - streamOpen(stream) { - this.$store.commit('setLibraryItemStream', stream.libraryItem) - this.playerHandler.prepareStream(stream) + sessionOpen(session) { + this.$store.commit('setLibraryItemStream', session.libraryItem) + this.playerHandler.prepareOpenSession(session) }, streamClosed(streamId) { // Stream was closed from the server @@ -282,7 +283,7 @@ export default { if (!libraryItem) return this.$store.commit('setLibraryItemStream', libraryItem) - this.playerHandler.load(libraryItem, true, this.userAudiobookCurrentTime) + this.playerHandler.load(libraryItem, true) } }, mounted() { diff --git a/client/components/cards/LazyBookCard.vue b/client/components/cards/LazyBookCard.vue index b479a307..0b4a3565 100644 --- a/client/components/cards/LazyBookCard.vue +++ b/client/components/cards/LazyBookCard.vue @@ -161,10 +161,12 @@ export default { return this._libraryItem.libraryId }, hasEbook() { - return this.media.numEbooks + if (!this.media.ebooks) return 0 + return this.media.ebooks.length }, - hasTracks() { - return this.media.numTracks + hasAudiobook() { + if (!this.media.audiobooks) return 0 + return this.media.audiobooks.length }, processingBatch() { return this.store.state.processingBatch @@ -244,7 +246,7 @@ export default { return !this.isSelectionMode && this.showExperimentalFeatures && !this.showPlayButton && this.hasEbook }, showPlayButton() { - return !this.isSelectionMode && !this.isMissing && !this.isInvalid && this.hasTracks && !this.isStreaming + return !this.isSelectionMode && !this.isMissing && !this.isInvalid && this.hasAudiobook && !this.isStreaming }, showSmallEBookIcon() { return !this.isSelectionMode && this.showExperimentalFeatures && this.hasEbook @@ -310,7 +312,7 @@ export default { } ] if (this.userCanUpdate) { - if (this.hasTracks) { + if (this.hasAudiobook) { items.push({ func: 'showEditModalTracks', text: 'Tracks' diff --git a/client/components/controls/FilterSelect.vue b/client/components/controls/FilterSelect.vue index 5908f388..2e45f450 100644 --- a/client/components/controls/FilterSelect.vue +++ b/client/components/controls/FilterSelect.vue @@ -175,7 +175,7 @@ export default { return this.filterData.languages || [] }, progress() { - return ['Read', 'Unread', 'In Progress'] + return ['Finished', 'In Progress', 'Not Started'] }, sublistItems() { return (this[this.sublist] || []).map((item) => { diff --git a/client/components/modals/item/tabs/Details.vue b/client/components/modals/item/tabs/Details.vue index f30bd583..5e149457 100644 --- a/client/components/modals/item/tabs/Details.vue +++ b/client/components/modals/item/tabs/Details.vue @@ -168,7 +168,6 @@ export default { }, async updateDetails(updatedDetails) { this.isProcessing = true - console.log('Sending update', updatedDetails.updatePayload) var updateResult = await this.$axios.$patch(`/api/items/${this.libraryItemId}/media`, updatedDetails.updatePayload).catch((error) => { console.error('Failed to update', error) return false diff --git a/client/components/modals/libraries/FolderChooser.vue b/client/components/modals/libraries/FolderChooser.vue index fca170ca..d41d16e9 100644 --- a/client/components/modals/libraries/FolderChooser.vue +++ b/client/components/modals/libraries/FolderChooser.vue @@ -64,7 +64,6 @@ export default { computed: { _directories() { return this.directories.map((d) => { - console.log('Directories', d) var isUsed = !!this.paths.find((path) => path.endsWith(d.path)) var isSelected = d.path === this.selectedPath var classes = [] diff --git a/client/components/tables/AllFilesTable.vue b/client/components/tables/AllFilesTable.vue deleted file mode 100644 index 57b000b9..00000000 --- a/client/components/tables/AllFilesTable.vue +++ /dev/null @@ -1,105 +0,0 @@ - - - \ No newline at end of file diff --git a/client/components/tables/UsersTable.vue b/client/components/tables/UsersTable.vue index 89b3232e..735f8432 100644 --- a/client/components/tables/UsersTable.vue +++ b/client/components/tables/UsersTable.vue @@ -26,11 +26,11 @@ {{ user.type }} -
-

Reading: {{ usersOnline[user.id].stream.libraryItem.media.metadata.title || '' }}

+
+

Listening: {{ usersOnline[user.id].session.libraryItem.media.metadata.title || '' }}

-
-

Last: {{ getLastRead(user.audiobooks) }}

+
+

Last: {{ user.mostRecent.metadata.title }}

@@ -78,23 +78,11 @@ export default { }, usersOnline() { var usermap = {} - this.$store.state.users.users.forEach((u) => (usermap[u.id] = { online: true, stream: u.stream })) + this.$store.state.users.users.forEach((u) => (usermap[u.id] = { online: true, session: u.session })) return usermap } }, methods: { - getLastRead(audiobooks) { - var abs = Object.values(audiobooks).filter((ab) => { - return ab.progress > 0 - }) - if (abs.length) { - abs = abs.sort((a, b) => b.lastUpdate - a.lastUpdate) - // Book object is attached on request - if (abs[0].book) return abs[0].book.title - return abs[0].audiobookTitle ? abs[0].audiobookTitle : null - } - return null - }, deleteUserClick(user) { if (this.isDeletingUser) return if (confirm(`Are you sure you want to permanently delete user "${user.username}"?`)) { diff --git a/client/components/ui/FileInput.vue b/client/components/ui/FileInput.vue index bdd3a266..291f8e1a 100644 --- a/client/components/ui/FileInput.vue +++ b/client/components/ui/FileInput.vue @@ -33,7 +33,6 @@ export default { var _files = Array.from(e.target.files) if (_files && _files.length) { var file = _files[0] - console.log('File', file) this.$emit('change', file) } } diff --git a/client/components/ui/QueryInput.vue b/client/components/ui/QueryInput.vue index c9bc337b..6eb6275a 100644 --- a/client/components/ui/QueryInput.vue +++ b/client/components/ui/QueryInput.vue @@ -78,7 +78,7 @@ export default { console.error('Failed to get search results', error) return [] }) - console.log('Search results', results) + // console.log('Search results', results) this.items = results || [] this.searching = false }, diff --git a/client/components/widgets/ItemDetailsEdit.vue b/client/components/widgets/ItemDetailsEdit.vue index 959a7012..12c9f2e4 100644 --- a/client/components/widgets/ItemDetailsEdit.vue +++ b/client/components/widgets/ItemDetailsEdit.vue @@ -276,7 +276,7 @@ export default { if (!matchingItem) return false for (var key in item) { if (item[key] !== matchingItem[key]) { - console.log('Object array item keys changed', key, item[key], matchingItem[key]) + // console.log('Object array item keys changed', key, item[key], matchingItem[key]) return false } } diff --git a/client/layouts/default.vue b/client/layouts/default.vue index 25a211bb..53d096f4 100644 --- a/client/layouts/default.vue +++ b/client/layouts/default.vue @@ -97,9 +97,9 @@ export default { return } console.log('Init Payload', payload) - if (payload.stream) { + if (payload.session) { if (this.$refs.streamContainer) { - this.$refs.streamContainer.streamOpen(payload.stream) + this.$refs.streamContainer.sessionOpen(payload.session) } else { console.warn('Stream Container not mounted') } diff --git a/client/nuxt.config.js b/client/nuxt.config.js index 63519131..2a583388 100644 --- a/client/nuxt.config.js +++ b/client/nuxt.config.js @@ -74,7 +74,6 @@ module.exports = { proxy: { '/dev/': { target: 'http://localhost:3333', pathRewrite: { '^/dev/': '' } }, - '/lib/': { target: process.env.NODE_ENV !== 'production' ? 'http://localhost:3333' : '/' }, '/ebook/': { target: process.env.NODE_ENV !== 'production' ? 'http://localhost:3333' : '/' }, '/s/': { target: process.env.NODE_ENV !== 'production' ? 'http://localhost:3333' : '/' }, '/metadata/': { target: process.env.NODE_ENV !== 'production' ? 'http://localhost:3333' : '/' } diff --git a/client/pages/audiobook/_id/edit.vue b/client/pages/audiobook/_id/edit.vue index 322b7237..074293b5 100644 --- a/client/pages/audiobook/_id/edit.vue +++ b/client/pages/audiobook/_id/edit.vue @@ -95,7 +95,7 @@ export default { if (!store.getters['user/getUserCanUpdate']) { return redirect('/?error=unauthorized') } - var payload = await app.$axios.$get(`/api/audiobooks/${params.id}/item?expanded=1`).catch((error) => { + var payload = await app.$axios.$get(`/api/entities/${params.id}/item?expanded=1`).catch((error) => { console.error('Failed', error) return false }) @@ -103,7 +103,7 @@ export default { console.error('Not found...', params.id) return redirect('/') } - const audiobook = payload.audiobook + const audiobook = payload.mediaEntity return { audiobook, libraryItem: payload.libraryItem, @@ -218,7 +218,7 @@ export default { this.saving = true this.$axios - .$patch(`/api/audiobooks/${this.audiobook.id}/tracks`, { orderedFileData }) + .$patch(`/api/entities/${this.audiobook.id}/tracks`, { orderedFileData }) .then((data) => { console.log('Finished patching files', data) this.saving = false diff --git a/client/pages/config/stats.vue b/client/pages/config/stats.vue index 2d05fcfd..d39a2e79 100644 --- a/client/pages/config/stats.vue +++ b/client/pages/config/stats.vue @@ -9,8 +9,8 @@ />
-

{{ userAudiobooksRead.length }}

-

Books Read

+

{{ userItemsFinished.length }}

+

Items Finished

@@ -35,17 +35,17 @@

Recent Listening Sessions

No Listening Sessions

-