diff --git a/client/components/app/Appbar.vue b/client/components/app/Appbar.vue index 9085f66d..2e3d8710 100644 --- a/client/components/app/Appbar.vue +++ b/client/components/app/Appbar.vue @@ -120,12 +120,10 @@ export default { } }, methods: { - back() { - if (this.$route.name === 'audiobook-id-edit') { - this.$router.push(`/audiobook/${this.$route.params.id}`) - } else { - this.$router.push('/library') - } + async back() { + var popped = await this.$store.dispatch('popRoute') + var backTo = popped || '/' + this.$router.push(backTo) }, cancelSelectionMode() { if (this.processingBatchDelete) return diff --git a/client/components/app/BookShelfCategorized.vue b/client/components/app/BookShelfCategorized.vue index b67c0a76..01711cfc 100644 --- a/client/components/app/BookShelfCategorized.vue +++ b/client/components/app/BookShelfCategorized.vue @@ -18,43 +18,7 @@
@@ -69,7 +33,9 @@ export default { rowPaddingX: 40, keywordFilterTimeout: null, scannerParseSubtitle: false, - wrapperClientWidth: 0 + wrapperClientWidth: 0, + overflowingShelvesRight: {}, + overflowingShelvesLeft: {} } }, computed: { @@ -95,7 +61,7 @@ export default { return this.bookCoverWidth + this.paddingX * 2 }, mostRecentPlayed() { - var audiobooks = this.audiobooks.filter((ab) => this.userAudiobooks[ab.id] && this.userAudiobooks[ab.id].lastUpdate > 0).map((ab) => ({ ...ab })) + var audiobooks = this.audiobooks.filter((ab) => this.userAudiobooks[ab.id] && this.userAudiobooks[ab.id].lastUpdate > 0 && this.userAudiobooks[ab.id].progress > 0 && !this.userAudiobooks[ab.id].isRead).map((ab) => ({ ...ab })) audiobooks.sort((a, b) => { return this.userAudiobooks[b.id].lastUpdate - this.userAudiobooks[a.id].lastUpdate }) @@ -190,45 +156,3 @@ export default { } } - - \ No newline at end of file diff --git a/client/components/app/BookShelfRow.vue b/client/components/app/BookShelfRow.vue new file mode 100644 index 00000000..07e53dc3 --- /dev/null +++ b/client/components/app/BookShelfRow.vue @@ -0,0 +1,139 @@ + + + + + \ No newline at end of file diff --git a/client/components/cards/BookCard.vue b/client/components/cards/BookCard.vue index 89bdbadd..b027d25d 100644 --- a/client/components/cards/BookCard.vue +++ b/client/components/cards/BookCard.vue @@ -8,9 +8,9 @@
-
+
-
+
diff --git a/client/middleware/routed.js b/client/middleware/routed.js new file mode 100644 index 00000000..db2e916d --- /dev/null +++ b/client/middleware/routed.js @@ -0,0 +1,19 @@ +export default function (context) { + if (process.client) { + var route = context.route + var from = context.from + var store = context.store + + if (route.name === 'login' || from.name === 'login') return + + if (route.name === 'config' || route.name === 'upload' || route.name === 'account' || route.name.startsWith('audiobook-id')) { + if (from.name !== route.name && from.name !== 'audiobook-id-edit' && from.name !== 'config' && from.name !== 'upload' && from.name !== 'account') { + var _history = [...store.state.routeHistory] + if (!_history.length || _history[_history.length - 1] !== from.fullPath) { + _history.push(from.fullPath) + store.commit('setRouteHistory', _history) + } + } + } + } +} diff --git a/client/nuxt.config.js b/client/nuxt.config.js index 87376fb6..1b771659 100644 --- a/client/nuxt.config.js +++ b/client/nuxt.config.js @@ -40,6 +40,10 @@ module.exports = { ] }, + router: { + middleware: ['routed'] + }, + // Global CSS: https://go.nuxtjs.dev/config-css css: [ '@/assets/app.css' diff --git a/client/package.json b/client/package.json index cc4d68df..add3355a 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "audiobookshelf-client", - "version": "1.2.6", + "version": "1.2.7", "description": "Audiobook manager and player", "main": "index.js", "scripts": { diff --git a/client/pages/config/index.vue b/client/pages/config/index.vue index d651e70b..cfd2a8db 100644 --- a/client/pages/config/index.vue +++ b/client/pages/config/index.vue @@ -1,5 +1,5 @@