Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8bb8c6aa64 | |||
| 109d3c8ac9 |
@@ -1 +1 @@
|
|||||||
v1.4.7
|
v1.4.8
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "aniworld-web",
|
"name": "aniworld-web",
|
||||||
"version": "1.4.7",
|
"version": "1.4.8",
|
||||||
"description": "Aniworld Anime Download Manager - Web Frontend",
|
"description": "Aniworld Anime Download Manager - Web Frontend",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -147,10 +147,7 @@ async def setup_auth(req: SetupRequest):
|
|||||||
# Trigger initialization in background task
|
# Trigger initialization in background task
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from src.server.services.initialization_service import (
|
from src.server.services.initialization_service import perform_initial_setup
|
||||||
perform_initial_setup,
|
|
||||||
perform_nfo_scan_if_needed,
|
|
||||||
)
|
|
||||||
from src.server.services.progress_service import get_progress_service
|
from src.server.services.progress_service import get_progress_service
|
||||||
|
|
||||||
progress_service = get_progress_service()
|
progress_service = get_progress_service()
|
||||||
@@ -161,9 +158,6 @@ async def setup_auth(req: SetupRequest):
|
|||||||
# Perform the initial series sync and mark as completed
|
# Perform the initial series sync and mark as completed
|
||||||
await perform_initial_setup(progress_service)
|
await perform_initial_setup(progress_service)
|
||||||
|
|
||||||
# Perform NFO scan if configured
|
|
||||||
await perform_nfo_scan_if_needed(progress_service)
|
|
||||||
|
|
||||||
# Start scheduler if anime_directory is now set
|
# Start scheduler if anime_directory is now set
|
||||||
try:
|
try:
|
||||||
from src.server.services.scheduler.scheduler_service import (
|
from src.server.services.scheduler.scheduler_service import (
|
||||||
|
|||||||
@@ -344,7 +344,6 @@ async def lifespan(_application: FastAPI):
|
|||||||
from src.server.services.initialization_service import (
|
from src.server.services.initialization_service import (
|
||||||
perform_initial_setup,
|
perform_initial_setup,
|
||||||
perform_media_scan_if_needed,
|
perform_media_scan_if_needed,
|
||||||
perform_nfo_scan_if_needed,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -373,9 +372,6 @@ async def lifespan(_application: FastAPI):
|
|||||||
"exist yet): %s", e
|
"exist yet): %s", e
|
||||||
)
|
)
|
||||||
|
|
||||||
# Run NFO scan only on first run (if configured)
|
|
||||||
await perform_nfo_scan_if_needed()
|
|
||||||
|
|
||||||
# Initialize download service
|
# Initialize download service
|
||||||
try:
|
try:
|
||||||
from src.server.utils.dependencies import get_download_service
|
from src.server.utils.dependencies import get_download_service
|
||||||
|
|||||||
@@ -127,21 +127,10 @@ class SetupRedirectMiddleware(BaseHTTPMiddleware):
|
|||||||
# Otherwise redirect to login
|
# Otherwise redirect to login
|
||||||
return RedirectResponse(url="/login", status_code=302)
|
return RedirectResponse(url="/login", status_code=302)
|
||||||
elif path == "/loading":
|
elif path == "/loading":
|
||||||
# Check if initialization is complete
|
# Always allow access to loading page - it handles its own
|
||||||
try:
|
# redirect flow via WebSocket events (initialization_complete
|
||||||
from src.server.database.connection import get_db_session
|
# event triggers redirect to /setup/unresolved)
|
||||||
from src.server.database.system_settings_service import (
|
pass
|
||||||
SystemSettingsService,
|
|
||||||
)
|
|
||||||
|
|
||||||
async with get_db_session() as db:
|
|
||||||
is_complete = await SystemSettingsService.is_initial_scan_completed(db)
|
|
||||||
if is_complete:
|
|
||||||
# Initialization complete, redirect to login
|
|
||||||
return RedirectResponse(url="/login", status_code=302)
|
|
||||||
except Exception:
|
|
||||||
# If we can't check, allow access to loading page
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Skip setup check for exempt paths
|
# Skip setup check for exempt paths
|
||||||
if self._is_path_exempt(path):
|
if self._is_path_exempt(path):
|
||||||
|
|||||||
@@ -281,15 +281,11 @@
|
|||||||
let isComplete = false;
|
let isComplete = false;
|
||||||
|
|
||||||
const stepOrder = [
|
const stepOrder = [
|
||||||
'series_sync',
|
'series_sync'
|
||||||
'nfo_scan',
|
|
||||||
'media_scan'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const stepTitles = {
|
const stepTitles = {
|
||||||
'series_sync': 'Syncing Series Database',
|
'series_sync': 'Syncing Series Database'
|
||||||
'nfo_scan': 'Processing NFO Metadata',
|
|
||||||
'media_scan': 'Scanning Media Files'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function connectWebSocket() {
|
function connectWebSocket() {
|
||||||
@@ -479,44 +475,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function checkUnresolvedAndProceed() {
|
async function checkUnresolvedAndProceed() {
|
||||||
try {
|
// Always redirect to /setup/unresolved after initialization
|
||||||
const token = localStorage.getItem('auth_token');
|
// so users can manually enter unresolved animes
|
||||||
console.log('Checking unresolved folders, token exists:', !!token);
|
window.location.href = '/setup/unresolved';
|
||||||
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';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showError(message) {
|
function showError(message) {
|
||||||
|
|||||||
Reference in New Issue
Block a user