series management tuning and import archive extraction troubleshooting

This commit is contained in:
Bryan Van Deusen
2026-01-23 23:05:25 -05:00
parent d3e73b9533
commit 9ebeeed133
7 changed files with 373 additions and 77 deletions
+36
View File
@@ -56,6 +56,7 @@
<button id="clearCompletedBtn" class="btn secondary-btn">Clear Completed</button>
<button id="regenMissingThumbsBtn" class="btn secondary-btn">Regenerate Missing Thumbnails</button>
<button id="reapplyArtistTagsBtn" class="btn secondary-btn">Reapply Artist Tags from Paths</button>
<button id="cleanupOrphanedTagsBtn" class="btn secondary-btn">Cleanup Orphaned Tags</button>
</div>
<div id="celeryWorkerInfo" style="margin-top: 1rem;">
@@ -762,6 +763,41 @@ document.addEventListener('DOMContentLoaded', () => {
}
});
// Cleanup Orphaned Tags
document.getElementById('cleanupOrphanedTagsBtn').addEventListener('click', async () => {
const btn = document.getElementById('cleanupOrphanedTagsBtn');
if (!confirm('This will delete all tags that are not attached to any images. Continue?')) {
return;
}
btn.disabled = true;
btn.textContent = 'Cleaning up...';
try {
const r = await fetch('/api/cleanup-orphaned-tags', { method: 'POST' });
const data = await r.json();
if (data.ok) {
if (data.deleted_count === 0) {
alert('No orphaned tags found.');
} else {
const tagList = data.deleted_tags.map(t => `${t.name} (${t.kind || 'user'})`).join('\n');
alert(`Deleted ${data.deleted_count} orphaned tag(s):\n\n${tagList}`);
}
// Refresh the tag dropdown if visible
loadTagsForDeletion();
} else {
alert('Failed: ' + (data.error || 'Unknown error'));
}
} catch (e) {
alert('Failed: ' + e.message);
} finally {
btn.disabled = false;
btn.textContent = 'Cleanup Orphaned Tags';
}
});
// Load import settings
fetch('/api/import-settings')
.then(r => r.json())