Explicit library filter not shown for users without permission

This commit is contained in:
advplyr 2025-06-21 17:01:13 -05:00
parent 5336d0525e
commit af684e6a69
2 changed files with 26 additions and 11 deletions

View File

@ -94,6 +94,9 @@ export default {
userIsAdminOrUp() {
return this.$store.getters['user/getIsAdminOrUp']
},
userCanAccessExplicitContent() {
return this.$store.getters['user/getUserCanAccessExplicitContent']
},
libraryMediaType() {
return this.$store.getters['libraries/getCurrentLibraryMediaType']
},
@ -228,11 +231,6 @@ export default {
value: 'abridged',
sublist: false
},
{
text: this.$strings.LabelExplicit,
value: 'explicit',
sublist: false
},
{
text: this.$strings.ButtonIssues,
value: 'issues',
@ -244,6 +242,15 @@ export default {
sublist: false
}
]
if (this.userCanAccessExplicitContent) {
items.push({
text: this.$strings.LabelExplicit,
value: 'explicit',
sublist: false
})
}
if (this.userIsAdminOrUp) {
items.push({
text: this.$strings.LabelShareOpen,
@ -254,7 +261,7 @@ export default {
return items
},
podcastItems() {
return [
const items = [
{
text: this.$strings.LabelAll,
value: 'all'
@ -277,11 +284,6 @@ export default {
value: 'languages',
sublist: true
},
{
text: this.$strings.LabelExplicit,
value: 'explicit',
sublist: false
},
{
text: this.$strings.ButtonIssues,
value: 'issues',
@ -293,6 +295,16 @@ export default {
sublist: false
}
]
if (this.userCanAccessExplicitContent) {
items.push({
text: this.$strings.LabelExplicit,
value: 'explicit',
sublist: false
})
}
return items
},
selectItems() {
if (this.isSeries) return this.seriesItems

View File

@ -58,6 +58,9 @@ export const getters = {
getUserCanAccessAllLibraries: (state) => {
return !!state.user?.permissions?.accessAllLibraries
},
getUserCanAccessExplicitContent: (state) => {
return !!state.user?.permissions?.accessExplicitContent
},
getLibrariesAccessible: (state, getters) => {
if (!state.user) return []
if (getters.getUserCanAccessAllLibraries) return []