jave: updates
This commit is contained in:
@@ -6,6 +6,7 @@ let currentMoviesPage = 1;
|
||||
let currentSeriesPage = 1;
|
||||
let dashboardData = null;
|
||||
let seriesSourcesLoaded = false;
|
||||
let authRetryAttempts = 0;
|
||||
|
||||
// Initialize app
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
@@ -204,7 +205,6 @@ async function loadMovies(page = 1) {
|
||||
const sourceFilter = document.getElementById('movies-filter-source').value;
|
||||
|
||||
const skip = (page - 1) * 100;
|
||||
console.log(`DEBUG: loadMovies called with page=${page}, calculated skip=${skip}`);
|
||||
|
||||
const params = new URLSearchParams({
|
||||
skip: skip,
|
||||
@@ -382,7 +382,6 @@ async function loadSeries(page = 1) {
|
||||
const sourceFilter = document.getElementById('series-filter-source').value;
|
||||
|
||||
const skip = (page - 1) * 50;
|
||||
console.log(`DEBUG: loadSeries called with page=${page}, calculated skip=${skip}`);
|
||||
|
||||
const params = new URLSearchParams({
|
||||
skip: skip,
|
||||
@@ -1361,8 +1360,16 @@ async function checkAuthStatus() {
|
||||
authUsernameSpan.textContent = authStatus.username;
|
||||
authStatusDiv.style.display = 'flex';
|
||||
} else if (authStatus.auth_enabled && !authStatus.authenticated) {
|
||||
// This shouldn't happen if middleware is working, but handle it
|
||||
console.warn('Auth enabled but not authenticated - middleware may be misconfigured');
|
||||
// This can happen briefly during page load - retry once after a short delay
|
||||
if (authRetryAttempts < 1) {
|
||||
authRetryAttempts++;
|
||||
console.debug('Auth enabled but not authenticated - retrying auth check in 500ms');
|
||||
setTimeout(() => {
|
||||
checkAuthStatus();
|
||||
}, 500);
|
||||
} else {
|
||||
console.warn('Auth enabled but not authenticated after retry - middleware may be misconfigured');
|
||||
}
|
||||
} else {
|
||||
// Authentication disabled - hide auth status
|
||||
authStatusDiv.style.display = 'none';
|
||||
|
||||
Reference in New Issue
Block a user