This commit is contained in:
2026-06-28 15:53:21 +02:00
parent 0be86771e1
commit 3fc1311d50
5 changed files with 311 additions and 76 deletions

View File

@@ -59,6 +59,7 @@ class AuthMiddleware(BaseHTTPMiddleware):
"/login", # Login page
"/setup", # Setup page
"/queue", # Queue page (needs to be accessible for initial load)
"/anime/settings", # Anime Settings page (auth handled by API, JS redirects to login)
}
def __init__(

View File

@@ -148,7 +148,7 @@ class SetupService:
results = await series_app.search(title)
if len(results) == 1:
result_name = results[0].get('title', '')
result_name = results[0].get('name', '')
result_link = results[0].get('link', '')
if SetupService._titles_match(result_name, title):
@@ -173,10 +173,19 @@ class SetupService:
)
elif len(results) > 1:
logger.debug(
"Multiple search results for title, skipping fuzzy match",
"Multiple search results for title, trying fuzzy match",
title=title,
result_count=len(results)
)
# Try fuzzy match across multiple results
for result in results:
result_name = result.get('name', '')
result_link = result.get('link', '')
if SetupService._titles_match(result_name, title):
if result_link and '/anime/stream/' in result_link:
return result_link.split('/anime/stream/')[-1].split('/')[0]
elif result_link:
return result_link
except Exception as e:
logger.warning(
"Provider search failed for folder",

View File

@@ -164,6 +164,10 @@ AniWorld.AnimeSettingsManager = (function () {
if (resp.status === 401) {
showError('Not authenticated — please log in again.');
showErrorState('Authentication required.');
// Redirect to login, preserving the intended destination
setTimeout(function() {
window.location.href = '/login?next=' + encodeURIComponent(window.location.href);
}, 1500);
return;
}
if (resp.status === 404) {