diff --git a/api/web_routes.py b/api/web_routes.py index 2393863..fc8fc45 100644 --- a/api/web_routes.py +++ b/api/web_routes.py @@ -454,14 +454,11 @@ async def get_movie_date_options(dependencies: dict, imdb_id: str): if not movie: raise HTTPException(status_code=404, detail="Movie not found") - # Debug logging to understand the data issue + # Debug logging (can be removed once Smart Fix is working) print(f"🔍 DEBUG: Movie data for {imdb_id}:") print(f" - released: {repr(movie.get('released'))}") print(f" - dateadded: {repr(movie.get('dateadded'))}") print(f" - source: {repr(movie.get('source'))}") - print(f" - path: {repr(movie.get('path'))}") - print(f" - has_video_file: {repr(movie.get('has_video_file'))}") - print(f" - last_updated: {repr(movie.get('last_updated'))}") options = [] diff --git a/static/js/app.js b/static/js/app.js index 2a9064f..7c48311 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -522,7 +522,9 @@ function refreshReport() { // Smart fix functions async function smartFixMovie(imdbId) { try { + console.log('🔍 SMART FIX: Loading options for movie', imdbId); const options = await apiCall(`/api/movies/${imdbId}/date-options`); + console.log('🔍 SMART FIX: Received options:', options); showSmartFixModal('movie', options); } catch (error) { console.error('Failed to load movie options:', error); @@ -541,10 +543,17 @@ async function smartFixEpisode(imdbId, season, episode) { } function showSmartFixModal(mediaType, options) { + console.log('🔍 SMART FIX: Showing modal for', mediaType, 'with options:', options); + const modal = document.getElementById('smart-fix-modal'); const title = document.getElementById('smart-fix-title'); const content = document.getElementById('smart-fix-content'); + if (!modal || !title || !content) { + console.error('❌ SMART FIX: Modal elements not found!', {modal, title, content}); + return; + } + if (mediaType === 'movie') { title.textContent = `Fix Date for Movie: ${options.imdb_id}`; } else {