fix: streamline initialization flow after setup

- Remove nfo_scan and media_scan from loading page steps (no longer shown in UI)
- Remove perform_nfo_scan_if_needed calls from fastapi_app and auth.py
- Always redirect to /setup/unresolved after initialization completes
  instead of conditionally checking for unresolved folders
- Fix middleware to allow access to /loading page - let it handle
  its own redirect flow via WebSocket events

This ensures users always reach the unresolved folders page after
initial setup to manually configure any unmatched anime series.
This commit is contained in:
2026-06-06 21:33:41 +02:00
parent 6a934db8ac
commit 109d3c8ac9
4 changed files with 10 additions and 70 deletions

View File

@@ -281,15 +281,11 @@
let isComplete = false;
const stepOrder = [
'series_sync',
'nfo_scan',
'media_scan'
'series_sync'
];
const stepTitles = {
'series_sync': 'Syncing Series Database',
'nfo_scan': 'Processing NFO Metadata',
'media_scan': 'Scanning Media Files'
'series_sync': 'Syncing Series Database'
};
function connectWebSocket() {
@@ -479,44 +475,9 @@
}
async function checkUnresolvedAndProceed() {
try {
const token = localStorage.getItem('auth_token');
console.log('Checking unresolved folders, token exists:', !!token);
if (!token) {
// No token, go to login
console.log('No auth token found, showing completion');
document.getElementById('completionMessage').style.display = 'block';
return;
}
const res = await fetch('/api/setup/unresolved', {
headers: { 'Authorization': `Bearer ${token}` }
});
console.log('Unresolved API response status:', res.status);
if (res.ok) {
const unresolved = await res.json();
console.log('Unresolved folders:', unresolved);
if (unresolved && unresolved.length > 0) {
// Has unresolved folders - redirect to unresolved page
console.log('Redirecting to /setup/unresolved');
window.location.href = '/setup/unresolved';
return;
}
} else if (res.status === 401) {
// Token invalid, clear it
localStorage.removeItem('auth_token');
console.log('Token invalid, showing completion');
document.getElementById('completionMessage').style.display = 'block';
return;
}
} catch (e) {
console.error('Error checking unresolved folders:', e);
}
// No unresolved folders or error - show completion message
console.log('No unresolved folders or error, showing completion');
document.getElementById('completionMessage').style.display = 'block';
// Always redirect to /setup/unresolved after initialization
// so users can manually enter unresolved animes
window.location.href = '/setup/unresolved';
}
function showError(message) {