mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-01 05:29:41 +00:00
Add ability to hide and unhide series
List of hidden series IDs is stored in user.extraData and hidden series are filtered out of the query on the server side.
This commit is contained in:
parent
8498378bca
commit
8fb763d81e
8 changed files with 133 additions and 0 deletions
|
|
@ -131,6 +131,10 @@ export default {
|
|||
{
|
||||
text: this.isSeriesFinished ? this.$strings.MessageMarkAsNotFinished : this.$strings.MessageMarkAsFinished,
|
||||
action: 'mark-series-finished'
|
||||
},
|
||||
{
|
||||
text: !this.isSeriesHidden ? this.$strings.LabelHideSeries : this.$strings.LabelUnhideSeries,
|
||||
action: 'hide-series'
|
||||
}
|
||||
]
|
||||
|
||||
|
|
@ -301,6 +305,10 @@ export default {
|
|||
if (!this.seriesId) return false
|
||||
return this.$store.getters['user/getIsSeriesRemovedFromContinueListening'](this.seriesId)
|
||||
},
|
||||
isSeriesHidden() {
|
||||
if (!this.seriesId) return false
|
||||
return this.$store.getters['user/getIsSeriesHidden'](this.seriesId)
|
||||
},
|
||||
filterBy() {
|
||||
return this.$store.getters['user/getUserSetting']('filterBy')
|
||||
},
|
||||
|
|
@ -439,6 +447,12 @@ export default {
|
|||
return
|
||||
}
|
||||
this.markSeriesFinished()
|
||||
} else if (action === 'hide-series') {
|
||||
if (this.processingSeries) {
|
||||
console.warn('Already processing series')
|
||||
return
|
||||
}
|
||||
this.markSeriesHidden()
|
||||
} else if (this.handleSubtitlesAction(action)) {
|
||||
return
|
||||
} else if (this.handleCollapseSubSeriesAction(action)) {
|
||||
|
|
@ -566,6 +580,33 @@ export default {
|
|||
}
|
||||
this.$store.commit('globals/setConfirmPrompt', payload)
|
||||
},
|
||||
markSeriesHidden() {
|
||||
const newIsHidden = !this.isSeriesHidden;
|
||||
|
||||
const payload = {
|
||||
message: newIsHidden ? this.$strings.MessageConfirmHideSeries : this.$strings.MessageConfirmUnhideSeries,
|
||||
callback: (confirmed) => {
|
||||
if (confirmed) {
|
||||
this.processingSeries = true
|
||||
const endpoint = newIsHidden ? 'hide' : 'unhide'
|
||||
this.$axios
|
||||
.$get(`/api/me/series/${this.seriesId}/${endpoint}`)
|
||||
.then(() => {
|
||||
this.$toast.success(this.$strings.ToastSeriesUpdateSuccess)
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toast.error(this.$strings.ToastSeriesUpdateFailed)
|
||||
console.error('Failed to batch update read/not read', error)
|
||||
})
|
||||
.finally(() => {
|
||||
this.processingSeries = false
|
||||
})
|
||||
}
|
||||
},
|
||||
type: 'yesNo'
|
||||
}
|
||||
this.$store.commit('globals/setConfirmPrompt', payload)
|
||||
},
|
||||
updateOrder() {
|
||||
this.saveSettings()
|
||||
},
|
||||
|
|
|
|||
|
|
@ -76,6 +76,10 @@ export const getters = {
|
|||
if (!state.user || !state.user.seriesHideFromContinueListening || !state.user.seriesHideFromContinueListening.length) return false
|
||||
return state.user.seriesHideFromContinueListening.includes(seriesId)
|
||||
},
|
||||
getIsSeriesHidden: (state) => (seriesId) => {
|
||||
if (!state.user || !state.user.hiddenSeries || !state.user.hiddenSeries.length) return false
|
||||
return state.user.hiddenSeries.includes(seriesId)
|
||||
},
|
||||
getSizeMultiplier: (state) => {
|
||||
return state.settings.bookshelfCoverSize / 120
|
||||
}
|
||||
|
|
|
|||
|
|
@ -394,6 +394,7 @@
|
|||
"LabelHardDeleteFile": "Hard delete file",
|
||||
"LabelHasEbook": "Has ebook",
|
||||
"LabelHasSupplementaryEbook": "Has supplementary ebook",
|
||||
"LabelHideSeries": "Hide Series",
|
||||
"LabelHideSubtitles": "Hide Subtitles",
|
||||
"LabelHighestPriority": "Highest priority",
|
||||
"LabelHost": "Host",
|
||||
|
|
@ -699,6 +700,7 @@
|
|||
"LabelType": "Type",
|
||||
"LabelUnabridged": "Unabridged",
|
||||
"LabelUndo": "Undo",
|
||||
"LabelUnhideSeries": "Unhide Series",
|
||||
"LabelUnknown": "Unknown",
|
||||
"LabelUnknownPublishDate": "Unknown publish date",
|
||||
"LabelUpdateCover": "Update Cover",
|
||||
|
|
@ -774,6 +776,7 @@
|
|||
"MessageConfirmDeleteSession": "Are you sure you want to delete this session?",
|
||||
"MessageConfirmEmbedMetadataInAudioFiles": "Are you sure you want to embed metadata in {0} audio files?",
|
||||
"MessageConfirmForceReScan": "Are you sure you want to force re-scan?",
|
||||
"MessageConfirmHideSeries": "Are you sure you want to hide this series?",
|
||||
"MessageConfirmMarkAllEpisodesFinished": "Are you sure you want to mark all episodes as finished?",
|
||||
"MessageConfirmMarkAllEpisodesNotFinished": "Are you sure you want to mark all episodes as not finished?",
|
||||
"MessageConfirmMarkItemFinished": "Are you sure you want to mark \"{0}\" as finished?",
|
||||
|
|
@ -804,6 +807,7 @@
|
|||
"MessageConfirmRenameTagWarning": "Warning! A similar tag with a different casing already exists \"{0}\".",
|
||||
"MessageConfirmResetProgress": "Are you sure you want to reset your progress?",
|
||||
"MessageConfirmSendEbookToDevice": "Are you sure you want to send {0} ebook \"{1}\" to device \"{2}\"?",
|
||||
"MessageConfirmUnhideSeries": "Are you sure you want to unhide this series?",
|
||||
"MessageConfirmUnlinkOpenId": "Are you sure you want to unlink this user from OpenID?",
|
||||
"MessageDaysListenedInTheLastYear": "{0} days listened in the last year",
|
||||
"MessageDownloadingEpisode": "Downloading episode",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue