From b43c35483fa0e769cd90fdc05a81bf74bf7483e1 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sat, 25 Apr 2026 23:56:18 -0400 Subject: [PATCH] feat(settings): library-validation UI and validate_files toggle Adds a 'Library Validation' card to the Settings page that wraps the backend sweep API: trigger button, last-run timestamp, scanned/suspect counts, by-format breakdown, and an expandable suspect-paths table. Polls every 10s for up to 5 minutes after a scan is queued so the report shows up without manual refreshing. Also adds a download.validate_files switch to the Download Settings section so the live per-file validation can be toggled from the UI instead of via direct DB edits. Co-Authored-By: Claude Opus 4.7 --- frontend/src/services/api.js | 2 + frontend/src/views/Settings.vue | 251 +++++++++++++++++++++++++++++++- 2 files changed, 251 insertions(+), 2 deletions(-) diff --git a/frontend/src/services/api.js b/frontend/src/services/api.js index af81987..34f60ea 100644 --- a/frontend/src/services/api.js +++ b/frontend/src/services/api.js @@ -62,6 +62,8 @@ export const settingsApi = { regenerateApiKey: () => api.post('/settings/api-key/regenerate'), getLogs: (params = {}) => api.get('/settings/logs', { params }), refreshStorageStats: () => api.post('/settings/storage-stats/refresh'), + getLibraryValidation: () => api.get('/settings/library-validation'), + runLibraryValidation: () => api.post('/settings/library-validation/run'), } // Platforms API diff --git a/frontend/src/views/Settings.vue b/frontend/src/views/Settings.vue index 359e35b..dcd1932 100644 --- a/frontend/src/views/Settings.vue +++ b/frontend/src/views/Settings.vue @@ -58,6 +58,16 @@ persistent-hint /> + + + + @@ -168,6 +178,152 @@ + + + + mdi-shield-search + Library Validation + + + +

+ Walks the downloads tree and reports files that fail magic-byte + validation — same checks the live download path uses, but applied to + your existing library to surface silently-truncated files. Reports + only; pre-existing files aren't moved. +

+ + + No scan has been run yet. + + + + mdi-progress-clock + Scan queued — refreshing report automatically. + + + +
+ + + + + mdi-refresh + Refresh + + + mdi-play + Run scan + + +
+ @@ -438,10 +594,10 @@