diff --git a/components/app/SideDrawer.vue b/components/app/SideDrawer.vue index 333a0624..9827156b 100644 --- a/components/app/SideDrawer.vue +++ b/components/app/SideDrawer.vue @@ -74,9 +74,6 @@ export default { username() { return this.user ? this.user.username : '' }, - socketConnected() { - return this.$store.state.socketConnected - }, navItems() { var items = [ { diff --git a/components/tables/podcast/EpisodeRow.vue b/components/tables/podcast/EpisodeRow.vue index 4551dcad..658b5e5d 100644 --- a/components/tables/podcast/EpisodeRow.vue +++ b/components/tables/podcast/EpisodeRow.vue @@ -27,7 +27,7 @@ -
+
audio_file {{ downloadItem ? 'downloading' : 'download' }} download_done @@ -69,6 +69,9 @@ export default { mediaType() { return 'podcast' }, + userCanDownload() { + return this.$store.getters['user/getUserCanDownload'] + }, audioFile() { return this.episode.audioFile }, diff --git a/pages/item/_id.vue b/pages/item/_id.vue index f0662415..64d34341 100644 --- a/pages/item/_id.vue +++ b/pages/item/_id.vue @@ -49,7 +49,7 @@ auto_stories Read {{ ebookFormat }} - + {{ downloadItem ? 'downloading' : 'download' }} @@ -117,6 +117,9 @@ export default { isIos() { return this.$platform === 'ios' }, + userCanDownload() { + return this.$store.getters['user/getUserCanDownload'] + }, isLocal() { return this.libraryItem.isLocal }, @@ -235,6 +238,9 @@ export default { showRead() { return this.ebookFile && this.ebookFormat !== 'pdf' }, + showDownload() { + return this.user && this.userCanDownload && this.showPlay && !this.hasLocal + }, ebookFile() { return this.media.ebookFile }, @@ -242,9 +248,6 @@ export default { if (!this.ebookFile) return null return this.ebookFile.ebookFormat }, - hasStoragePermission() { - return this.$store.state.hasStoragePermission - }, downloadItem() { return this.$store.getters['globals/getDownloadItem'](this.libraryItemId) }, diff --git a/store/user.js b/store/user.js index 554a0e10..63cce4c5 100644 --- a/store/user.js +++ b/store/user.js @@ -35,6 +35,9 @@ export const getters = { }, getUserSetting: (state) => (key) => { return state.settings ? state.settings[key] || null : null + }, + getUserCanDownload: (state) => { + return state.user && state.user.permissions ? !!state.user.permissions.download : false } }