diff --git a/client/components/app/BookShelfToolbar.vue b/client/components/app/BookShelfToolbar.vue
index 3a173d93..6e367c3f 100644
--- a/client/components/app/BookShelfToolbar.vue
+++ b/client/components/app/BookShelfToolbar.vue
@@ -50,18 +50,8 @@
-
-
- {{ $strings.LabelMarkSeries }} {{ isSeriesFinished ? $strings.LabelNotFinished : $strings.LabelFinished }}
-
- Re-Add Series to Continue Listening
+
+
@@ -114,10 +104,42 @@ export default {
totalEntities: 0,
processingSeries: false,
processingIssues: false,
- processingAuthors: false
+ processingAuthors: false,
+ contextMenuItems: [
+ {
+ text: 'cat',
+ action: 'dog'
+ }
+ ]
}
},
computed: {
+ seriesContextMenuItems() {
+ if (!this.selectedSeries) return []
+
+ const items = [
+ {
+ text: this.isSeriesFinished ? 'Mark series as not finished' : 'Mark series as finished',
+ action: 'mark-series-finished'
+ }
+ ]
+
+ if (this.userIsAdminOrUp || this.selectedSeries.rssFeed) {
+ items.push({
+ text: this.$strings.LabelOpenRSSFeed,
+ action: 'open-rss-feed'
+ })
+ }
+
+ if (this.isSeriesRemovedFromContinueListening) {
+ items.push({
+ text: 'Re-Add Series to Continue Listening',
+ action: 're-add-to-continue-listening'
+ })
+ }
+
+ return items
+ },
seriesSortItems() {
return [
{
@@ -229,6 +251,23 @@ export default {
}
},
methods: {
+ seriesContextMenuAction(action) {
+ if (action === 'open-rss-feed') {
+ // TODO: Open RSS Feed
+ } else if (action === 're-add-to-continue-listening') {
+ if (this.processingSeries) {
+ console.warn('Already processing series')
+ return
+ }
+ this.reAddSeriesToContinueListening()
+ } else if (action === 'mark-series-finished') {
+ if (this.processingSeries) {
+ console.warn('Already processing series')
+ return
+ }
+ this.markSeriesFinished()
+ }
+ },
reAddSeriesToContinueListening() {
this.processingSeries = true
this.$axios
@@ -293,27 +332,39 @@ export default {
}
},
markSeriesFinished() {
- var newIsFinished = !this.isSeriesFinished
- this.processingSeries = true
- var updateProgressPayloads = this.seriesLibraryItemIds.map((lid) => {
- return {
- libraryItemId: lid,
- isFinished: newIsFinished
- }
- })
- console.log('Progress payloads', updateProgressPayloads)
- this.$axios
- .patch(`/api/me/progress/batch/update`, updateProgressPayloads)
- .then(() => {
- this.$toast.success('Series update success')
- this.selectedSeries.progress.isFinished = newIsFinished
- this.processingSeries = false
- })
- .catch((error) => {
- this.$toast.error('Series update failed')
- console.error('Failed to batch update read/not read', error)
- this.processingSeries = false
- })
+ const newIsFinished = !this.isSeriesFinished
+
+ const message = newIsFinished ? 'Are you sure you want to mark all books in this series as finished?' : 'Are you sure you want to reset your progress on all books in this series?'
+
+ const payload = {
+ message,
+ callback: (confirmed) => {
+ if (confirmed) {
+ this.processingSeries = true
+ const updateProgressPayloads = this.seriesLibraryItemIds.map((lid) => {
+ return {
+ libraryItemId: lid,
+ isFinished: newIsFinished
+ }
+ })
+ console.log('Progress payloads', updateProgressPayloads)
+ this.$axios
+ .patch(`/api/me/progress/batch/update`, updateProgressPayloads)
+ .then(() => {
+ this.$toast.success('Series update success')
+ this.selectedSeries.progress.isFinished = newIsFinished
+ this.processingSeries = false
+ })
+ .catch((error) => {
+ this.$toast.error('Series update failed')
+ console.error('Failed to batch update read/not read', error)
+ this.processingSeries = false
+ })
+ }
+ },
+ type: 'yesNo'
+ }
+ this.$store.commit('globals/setConfirmPrompt', payload)
},
updateOrder() {
this.saveSettings()