series management tuning and import archive extraction troubleshooting
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user