diff --git a/client/assets/fonts.css b/client/assets/fonts.css index f3c586e3..167aa81b 100644 --- a/client/assets/fonts.css +++ b/client/assets/fonts.css @@ -26,7 +26,7 @@ -webkit-font-smoothing: antialiased; } -.material-icons:not(.text-xs):not(.text-sm):not(.text-md):not(.text-base):not(.text-lg):not(.text-xl):not(.text-2xl):not(.text-3xl):not(.text-4xl):not(.text-5xl):not(.text-6xl):not(.text-7xl):not(.text-8xl) { +.material-icons:not([class*="text-"]) { font-size: 1.5rem; } @@ -44,11 +44,10 @@ -webkit-font-smoothing: antialiased; } -.material-icons-outlined:not(.text-xs):not(.text-sm):not(.text-md):not(.text-base):not(.text-lg):not(.text-xl):not(.text-2xl):not(.text-3xl):not(.text-4xl):not(.text-5xl):not(.text-6xl):not(.text-7xl):not(.text-8xl) { +.material-icons-outlined:not([class*="text-"]) { font-size: 1.5rem; } - @font-face { font-family: 'Gentium Book Basic'; font-style: normal; diff --git a/client/components/app/Appbar.vue b/client/components/app/Appbar.vue index f39e8839..836b0977 100644 --- a/client/components/app/Appbar.vue +++ b/client/components/app/Appbar.vue @@ -46,8 +46,12 @@
-

{{ $getString('MessageItemsSelected', [numLibraryItemsSelected]) }}

+

{{ $getString('MessageItemsSelected', [numLibraryItemsSelected]) }}

+ + play_arrow + {{ $strings.ButtonPlay }} + @@ -59,14 +63,14 @@ - + - close + close
@@ -77,9 +81,7 @@ export default { data() { return { - processingBatchDelete: false, - totalEntities: 0, - isAllSelected: false + totalEntities: 0 } }, computed: { @@ -149,11 +151,47 @@ export default { } }, methods: { - cancelSelectionMode() { - if (this.processingBatchDelete) return + async playSelectedItems() { + this.$store.commit('setProcessingBatch', true) + + var libraryItems = await this.$axios.$post(`/api/items/batch/get`, { libraryItemIds: this.selectedLibraryItems }).catch((error) => { + var errorMsg = error.response.data || 'Failed to get items' + console.error(errorMsg, error) + this.$toast.error(errorMsg) + return [] + }) + + if (!libraryItems.length) { + this.$store.commit('setProcessingBatch', false) + return + } + + const queueItems = [] + libraryItems.forEach((item) => { + queueItems.push({ + libraryItemId: item.id, + libraryId: item.libraryId, + episodeId: null, + title: item.media.metadata.title, + subtitle: item.media.metadata.authors.map((au) => au.name).join(', '), + caption: '', + duration: item.media.duration || null, + coverPath: item.media.coverPath || null + }) + }) + + this.$eventBus.$emit('play-item', { + libraryItemId: queueItems[0].libraryItemId, + queueItems + }) + this.$store.commit('setProcessingBatch', false) + this.$store.commit('setSelectedLibraryItems', []) + this.$eventBus.$emit('bookshelf_clear_selection') + }, + cancelSelectionMode() { + if (this.processingBatch) return this.$store.commit('setSelectedLibraryItems', []) this.$eventBus.$emit('bookshelf_clear_selection') - this.isAllSelected = false }, toggleBatchRead() { this.$store.commit('setProcessingBatch', true) @@ -183,7 +221,6 @@ export default { 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) this.$axios .$post(`/api/items/batch/delete`, { @@ -191,7 +228,6 @@ export default { }) .then(() => { this.$toast.success('Batch delete success!') - this.processingBatchDelete = false this.$store.commit('setProcessingBatch', false) this.$store.commit('setSelectedLibraryItems', []) this.$eventBus.$emit('bookshelf_clear_selection') @@ -199,7 +235,6 @@ export default { .catch((error) => { this.$toast.error('Batch delete failed') console.error('Failed to batch delete', error) - this.processingBatchDelete = false this.$store.commit('setProcessingBatch', false) }) } diff --git a/client/components/player/PlayerUi.vue b/client/components/player/PlayerUi.vue index 1f723294..7c78d982 100644 --- a/client/components/player/PlayerUi.vue +++ b/client/components/player/PlayerUi.vue @@ -7,7 +7,7 @@