From 6d64812c94182d93b31eb538afa98fb5f167496c Mon Sep 17 00:00:00 2001 From: SBCrumb Date: Sat, 25 Oct 2025 15:11:25 -0400 Subject: [PATCH] WEB: INTERFACE AND AUTH FAILS TO DELETE --- nfoguard-web/static/index.html | 2 +- nfoguard-web/static/js/app.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/nfoguard-web/static/index.html b/nfoguard-web/static/index.html index 2b1112f..212eb61 100644 --- a/nfoguard-web/static/index.html +++ b/nfoguard-web/static/index.html @@ -457,6 +457,6 @@
- + \ No newline at end of file diff --git a/nfoguard-web/static/js/app.js b/nfoguard-web/static/js/app.js index 7d68e47..c6323a0 100644 --- a/nfoguard-web/static/js/app.js +++ b/nfoguard-web/static/js/app.js @@ -92,6 +92,7 @@ function initializeEventListeners() { async function apiCall(endpoint, options = {}) { try { const response = await fetch(endpoint, { + credentials: 'include', // Include cookies for authentication headers: { 'Content-Type': 'application/json', ...options.headers @@ -912,7 +913,7 @@ function showEnhancedEditModal(mediaType, options, currentDateadded, currentSour `; // Add available date options - options.options.forEach((option, index) => { + (options.date_options || options.options || []).forEach((option, index) => { const isSelected = option.source === currentSource ? 'checked' : ''; const optionId = `date-option-${index}`; @@ -1086,7 +1087,14 @@ async function editEpisode(imdbId, season, episode, dateadded, source) { try { // Load episode options to populate available dates - const options = await apiCall(`/api/episodes/${imdbId}/${season}/${episode}/date-options`); + const dateOptions = await apiCall(`/api/episodes/${imdbId}/${season}/${episode}/date-options`); + // Create options object with episode metadata + const options = { + imdb_id: imdbId, + season: season, + episode: episode, + date_options: dateOptions.options || [] + }; showEnhancedEditModal('episode', options, dateadded, source); } catch (error) { console.error('Failed to load episode options for edit:', error);