mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-01 05:29:41 +00:00
feat: add library-wide consolidation status update tool and improve consolidation robustness
This commit is contained in:
parent
2c77f1fc5a
commit
c2693e2460
8 changed files with 118 additions and 11 deletions
|
|
@ -37,6 +37,18 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="isBookLibrary" class="w-full border border-black-200 p-4 my-8">
|
||||
<div class="flex flex-wrap items-center">
|
||||
<div>
|
||||
<p class="text-lg">{{ $strings.LabelUpdateConsolidationStatus }}</p>
|
||||
<p class="max-w-sm text-sm pt-2 text-gray-300">{{ $strings.LabelUpdateConsolidationStatusHelp }}</p>
|
||||
</div>
|
||||
<div class="grow" />
|
||||
<div>
|
||||
<ui-btn @click.stop="updateConsolidationStatusClick">{{ $strings.ButtonUpdate }}</ui-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -158,6 +170,34 @@ export default {
|
|||
.finally(() => {
|
||||
this.$emit('update:processing', false)
|
||||
})
|
||||
},
|
||||
updateConsolidationStatusClick() {
|
||||
const payload = {
|
||||
message: this.$strings.MessageConfirmUpdateConsolidationStatus,
|
||||
persistent: true,
|
||||
callback: (confirmed) => {
|
||||
if (confirmed) {
|
||||
this.updateConsolidationStatus()
|
||||
}
|
||||
},
|
||||
type: 'yesNo'
|
||||
}
|
||||
this.$store.commit('globals/setConfirmPrompt', payload)
|
||||
},
|
||||
updateConsolidationStatus() {
|
||||
this.$emit('update:processing', true)
|
||||
this.$axios
|
||||
.$post(`/api/libraries/${this.libraryId}/update-consolidation`)
|
||||
.then((data) => {
|
||||
this.$toast.success(this.$getString('ToastUpdateConsolidationStatusSuccess', [data.updated]))
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to update consolidation status', error)
|
||||
this.$toast.error(this.$strings.ToastUpdateConsolidationStatusFailed)
|
||||
})
|
||||
.finally(() => {
|
||||
this.$emit('update:processing', false)
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {}
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@
|
|||
"ButtonStartMetadataEmbed": "Start Metadata Embed",
|
||||
"ButtonStats": "Stats",
|
||||
"ButtonSubmit": "Submit",
|
||||
"ButtonUpdate": "Update",
|
||||
"ButtonTest": "Test",
|
||||
"ButtonUnlinkOpenId": "Unlink OpenID",
|
||||
"ButtonUpload": "Upload",
|
||||
|
|
@ -286,6 +287,8 @@
|
|||
"LabelChaptersFound": "chapters found",
|
||||
"LabelCleanupAuthors": "Cleanup authors",
|
||||
"LabelCleanupAuthorsHelp": "Remove authors that have no books in this library.",
|
||||
"LabelUpdateConsolidationStatus": "Update Consolidation Status",
|
||||
"LabelUpdateConsolidationStatusHelp": "Checks all items in this library and updates their consolidation status. This is useful if you have manually moved folders on disk.",
|
||||
"LabelClickForMoreInfo": "Click for more info",
|
||||
"LabelClickToUseCurrentValue": "Click to use current value",
|
||||
"LabelClosePlayer": "Close player",
|
||||
|
|
@ -806,6 +809,7 @@
|
|||
"MessageConfirmRemoveEpisode": "Are you sure you want to remove episode \"{0}\"?",
|
||||
"MessageConfirmRemoveItemsWithIssues": "Are you sure you want to remove all items with issues?",
|
||||
"MessageConfirmCleanupAuthors": "Are you sure you want to remove all authors with no books in this library?",
|
||||
"MessageConfirmUpdateConsolidationStatus": "Are you sure you want to update the consolidation status for all items in this library? This will re-calculate the 'Not Consolidated' badge for every book.",
|
||||
"MessageConfirmRemoveEpisodeNote": "Note: This does not delete the audio file unless toggling \"Hard delete file\"",
|
||||
"MessageConfirmRemoveEpisodes": "Are you sure you want to remove {0} episodes?",
|
||||
"MessageConfirmRemoveListeningSessions": "Are you sure you want to remove {0} listening sessions?",
|
||||
|
|
@ -1188,6 +1192,8 @@
|
|||
"ToastUserPasswordMismatch": "Passwords do not match",
|
||||
"ToastUserPasswordMustChange": "New password cannot match old password",
|
||||
"ToastUserRootRequireName": "Must enter a root username",
|
||||
"ToastUpdateConsolidationStatusSuccess": "Successfully updated consolidation status for {0} items.",
|
||||
"ToastUpdateConsolidationStatusFailed": "Failed to update consolidation status.",
|
||||
"TooltipAddChapters": "Add chapter(s)",
|
||||
"TooltipAddOneSecond": "Add 1 second",
|
||||
"TooltipAdjustChapterStart": "Click to adjust start time",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue