mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-01 05:29:41 +00:00
Allow removing all items with issues from tools
This commit is contained in:
parent
653db18679
commit
1cd6473b26
2 changed files with 46 additions and 0 deletions
|
|
@ -13,6 +13,18 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full border border-black-200 p-4 my-8">
|
||||
<div class="flex flex-wrap items-center">
|
||||
<div>
|
||||
<p class="text-lg">{{ $strings.LabelRemoveItemsWithIssues }}</p>
|
||||
<p class="max-w-sm text-sm pt-2 text-gray-300">{{ $strings.LabelRemoveItemsWithIssuesHelp }}</p>
|
||||
</div>
|
||||
<div class="grow" />
|
||||
<div>
|
||||
<ui-btn @click.stop="removeItemsWithIssuesClick">{{ $strings.ButtonRemove }}</ui-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -74,6 +86,34 @@ export default {
|
|||
.finally(() => {
|
||||
this.$emit('update:processing', false)
|
||||
})
|
||||
},
|
||||
removeItemsWithIssuesClick() {
|
||||
const payload = {
|
||||
message: this.$strings.MessageConfirmRemoveItemsWithIssues,
|
||||
persistent: true,
|
||||
callback: (confirmed) => {
|
||||
if (confirmed) {
|
||||
this.removeItemsWithIssuesInLibrary()
|
||||
}
|
||||
},
|
||||
type: 'yesNo'
|
||||
}
|
||||
this.$store.commit('globals/setConfirmPrompt', payload)
|
||||
},
|
||||
removeItemsWithIssuesInLibrary() {
|
||||
this.$emit('update:processing', true)
|
||||
this.$axios
|
||||
.$delete(`/api/libraries/${this.libraryId}/issues`)
|
||||
.then(() => {
|
||||
this.$toast.success(this.$strings.ToastLibraryItemsWithIssuesRemoved)
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to remove items with issues', error)
|
||||
this.$toast.error(this.$strings.ToastLibraryItemsWithIssuesRemoveFailed)
|
||||
})
|
||||
.finally(() => {
|
||||
this.$emit('update:processing', false)
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {}
|
||||
|
|
|
|||
|
|
@ -564,6 +564,8 @@
|
|||
"LabelRemoveAllMetadataJson": "Remove all metadata.json files",
|
||||
"LabelRemoveAudibleBranding": "Remove Audible intro and outro from chapters",
|
||||
"LabelRemoveCover": "Remove cover",
|
||||
"LabelRemoveItemsWithIssues": "Remove items with issues",
|
||||
"LabelRemoveItemsWithIssuesHelp": "Remove all items that are missing or invalid.",
|
||||
"LabelRemoveMetadataFile": "Remove metadata files in library item folders",
|
||||
"LabelRemoveMetadataFileHelp": "Remove all metadata.json and metadata.abs files in your {0} folders.",
|
||||
"LabelRowsPerPage": "Rows per page",
|
||||
|
|
@ -797,6 +799,7 @@
|
|||
"MessageConfirmRemoveAuthor": "Are you sure you want to remove author \"{0}\"?",
|
||||
"MessageConfirmRemoveCollection": "Are you sure you want to remove collection \"{0}\"?",
|
||||
"MessageConfirmRemoveEpisode": "Are you sure you want to remove episode \"{0}\"?",
|
||||
"MessageConfirmRemoveItemsWithIssues": "Are you sure you want to remove all items with issues?",
|
||||
"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?",
|
||||
|
|
@ -1079,6 +1082,9 @@
|
|||
"ToastLibraryDeleteFailed": "Failed to delete library",
|
||||
"ToastLibraryDeleteSuccess": "Library deleted",
|
||||
"ToastLibraryScanFailedToStart": "Failed to start scan",
|
||||
"ToastLibraryItemsWithIssuesNoneFound": "No items with issues found",
|
||||
"ToastLibraryItemsWithIssuesRemoved": "Removed items with issues",
|
||||
"ToastLibraryItemsWithIssuesRemoveFailed": "Failed to remove items with issues",
|
||||
"ToastLibraryScanStarted": "Library scan started",
|
||||
"ToastLibraryUpdateSuccess": "Library \"{0}\" updated",
|
||||
"ToastMatchAllAuthorsFailed": "Failed to match all authors",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue