diff --git a/client/components/app/Appbar.vue b/client/components/app/Appbar.vue index b04ec7f5..e6bc3b4f 100644 --- a/client/components/app/Appbar.vue +++ b/client/components/app/Appbar.vue @@ -7,13 +7,25 @@ arrow_back

AudioBookshelf

- + + + + + +
+ + + + +

{{ libraryName }}

+
+
@@ -66,11 +78,17 @@ export default { } }, computed: { + currentLibrary() { + return this.$store.getters['libraries/getCurrentLibrary'] + }, + libraryName() { + return this.currentLibrary ? this.currentLibrary.name : 'unknown' + }, isHome() { - return this.$route.name === 'index' + return this.$route.name === 'library-library' }, showBack() { - return this.$route.name !== 'library-id' && !this.isHome + return this.$route.name !== 'library-library-bookshelf-id' && !this.isHome }, user() { return this.$store.state.user.user @@ -78,7 +96,6 @@ export default { isRootUser() { return this.$store.getters['user/getIsRoot'] }, - username() { return this.user ? this.user.username : 'err' }, @@ -125,6 +142,9 @@ export default { } }, methods: { + clickLibrary() { + this.$store.commit('libraries/setShowModal', true) + }, async back() { var popped = await this.$store.dispatch('popRoute') var backTo = popped || '/' diff --git a/client/components/app/BookShelf.vue b/client/components/app/BookShelf.vue index ed62546b..62ebf1f1 100644 --- a/client/components/app/BookShelf.vue +++ b/client/components/app/BookShelf.vue @@ -216,7 +216,7 @@ export default { } }, scan() { - this.$root.socket.emit('scan') + this.$root.socket.emit('scan', this.$store.state.libraries.currentLibraryId) } }, updated() { diff --git a/client/components/app/BookShelfCategorized.vue b/client/components/app/BookShelfCategorized.vue index 38b19ff7..7a279a3e 100644 --- a/client/components/app/BookShelfCategorized.vue +++ b/client/components/app/BookShelfCategorized.vue @@ -143,7 +143,7 @@ export default { } }, scan() { - this.$root.socket.emit('scan') + this.$root.socket.emit('scan', this.$store.state.libraries.currentLibraryId) } }, mounted() { diff --git a/client/components/app/SideRail.vue b/client/components/app/SideRail.vue index 930ada30..f8e24c24 100644 --- a/client/components/app/SideRail.vue +++ b/client/components/app/SideRail.vue @@ -1,7 +1,7 @@