feat(ui): add Rescan button to Edit Metadata dialog
Release / build-and-push (push) Successful in 2m50s

Adds a Rescan button to the MetadataEditorModal footer that POSTs to the
new per-book rescan endpoint, with rescanning state (disabled + spinner,
matching the existing Mark Read pattern), success/error toasts, and a
page reload to pick up the refreshed cover and metadata.
This commit is contained in:
2026-09-11 23:08:20 -04:00
parent 298330a3a8
commit da1f689263
3 changed files with 52 additions and 3 deletions
+14 -1
View File
@@ -609,7 +609,19 @@ templ MetadataEditorModal(book handlers.MediaDetail) {
</div>
</div>
</div>
<div class="flex justify-end space-x-3 p-6 border-t flex-shrink-0" style="border-color: var(--border);">
<div class="flex items-center justify-between p-6 border-t flex-shrink-0" style="border-color: var(--border);">
<button
@click="rescanBook()"
:disabled="rescanning"
class="btn btn-secondary"
>
<span x-show="!rescanning" class="inline-flex items-center gap-2">@Icon("sync", "h-4 w-4")<span>Rescan</span></span>
<svg x-show="rescanning" class="animate-spin inline-block h-5 w-5" viewBox="0 0 24 24" fill="none">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path>
</svg>
</button>
<div class="flex space-x-3">
<button
@click="hideMetadataEditor()"
class="btn btn-secondary"
@@ -625,5 +637,6 @@ templ MetadataEditorModal(book handlers.MediaDetail) {
</button>
</div>
</div>
</div>
</div>
}