fix: smart fix date issues
Local Docker Build (Dev) / build-dev (push) Successful in 4s

This commit is contained in:
2025-10-14 15:53:11 -04:00
parent 212e51e54f
commit 00f2b77bfb
2 changed files with 10 additions and 4 deletions
+1 -4
View File
@@ -454,14 +454,11 @@ async def get_movie_date_options(dependencies: dict, imdb_id: str):
if not movie: if not movie:
raise HTTPException(status_code=404, detail="Movie not found") 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"🔍 DEBUG: Movie data for {imdb_id}:")
print(f" - released: {repr(movie.get('released'))}") print(f" - released: {repr(movie.get('released'))}")
print(f" - dateadded: {repr(movie.get('dateadded'))}") print(f" - dateadded: {repr(movie.get('dateadded'))}")
print(f" - source: {repr(movie.get('source'))}") 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 = [] options = []
+9
View File
@@ -522,7 +522,9 @@ function refreshReport() {
// Smart fix functions // Smart fix functions
async function smartFixMovie(imdbId) { async function smartFixMovie(imdbId) {
try { try {
console.log('🔍 SMART FIX: Loading options for movie', imdbId);
const options = await apiCall(`/api/movies/${imdbId}/date-options`); const options = await apiCall(`/api/movies/${imdbId}/date-options`);
console.log('🔍 SMART FIX: Received options:', options);
showSmartFixModal('movie', options); showSmartFixModal('movie', options);
} catch (error) { } catch (error) {
console.error('Failed to load movie options:', error); console.error('Failed to load movie options:', error);
@@ -541,10 +543,17 @@ async function smartFixEpisode(imdbId, season, episode) {
} }
function showSmartFixModal(mediaType, options) { function showSmartFixModal(mediaType, options) {
console.log('🔍 SMART FIX: Showing modal for', mediaType, 'with options:', options);
const modal = document.getElementById('smart-fix-modal'); const modal = document.getElementById('smart-fix-modal');
const title = document.getElementById('smart-fix-title'); const title = document.getElementById('smart-fix-title');
const content = document.getElementById('smart-fix-content'); 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') { if (mediaType === 'movie') {
title.textContent = `Fix Date for Movie: ${options.imdb_id}`; title.textContent = `Fix Date for Movie: ${options.imdb_id}`;
} else { } else {