diff --git a/client/components/tables/EbookFilesTable.vue b/client/components/tables/EbookFilesTable.vue
index 623dc39c..0c85774c 100644
--- a/client/components/tables/EbookFilesTable.vue
+++ b/client/components/tables/EbookFilesTable.vue
@@ -20,7 +20,7 @@
{{ $strings.LabelRead }} info
|
- |
+ |
@@ -58,20 +58,20 @@ export default {
userCanDelete() {
return this.$store.getters['user/getUserCanDelete']
},
+ userCanUpdate() {
+ return this.$store.getters['user/getUserCanUpdate']
+ },
userIsAdmin() {
return this.$store.getters['user/getIsAdminOrUp']
},
+ libraryIsAudiobooksOnly() {
+ return this.$store.getters['libraries/getLibraryIsAudiobooksOnly']
+ },
+ showMoreColumn() {
+ return this.userCanDelete || this.userCanDownload || (this.userCanUpdate && !this.libraryIsAudiobooksOnly)
+ },
ebookFiles() {
return (this.libraryItem.libraryFiles || []).filter((lf) => lf.fileType === 'ebook')
- },
- ebookFileIno() {
- return this.libraryItem.media.ebookFile?.ino
- },
- audioFiles() {
- if (this.libraryItem.mediaType === 'podcast') {
- return this.libraryItem.media?.episodes.map((ep) => ep.audioFile) || []
- }
- return this.libraryItem.media?.audioFiles || []
}
},
methods: {
diff --git a/client/store/user.js b/client/store/user.js
index 37f8e9c3..64b1776e 100644
--- a/client/store/user.js
+++ b/client/store/user.js
@@ -33,22 +33,22 @@ export const getters = {
return state.user.bookmarks.filter(bm => bm.libraryItemId === libraryItemId)
},
getUserSetting: (state) => (key) => {
- return state.settings ? state.settings[key] : null
+ return state.settings?.[key] || null
},
getUserCanUpdate: (state) => {
- return state.user && state.user.permissions ? !!state.user.permissions.update : false
+ return !!state.user?.permissions?.update
},
getUserCanDelete: (state) => {
- return state.user && state.user.permissions ? !!state.user.permissions.delete : false
+ return !!state.user?.permissions?.delete
},
getUserCanDownload: (state) => {
- return state.user && state.user.permissions ? !!state.user.permissions.download : false
+ return !!state.user?.permissions?.download
},
getUserCanUpload: (state) => {
- return state.user && state.user.permissions ? !!state.user.permissions.upload : false
+ return !!state.user?.permissions?.upload
},
getUserCanAccessAllLibraries: (state) => {
- return state.user && state.user.permissions ? !!state.user.permissions.accessAllLibraries : false
+ return !!state.user?.permissions?.accessAllLibraries
},
getLibrariesAccessible: (state, getters) => {
if (!state.user) return []