dev #62

Merged
sbcrumb merged 56 commits from dev into main 2025-10-26 15:45:15 -04:00
Showing only changes of commit eb66af837f - Show all commits
+14
View File
@@ -581,11 +581,25 @@ async def update_episode_date(dependencies: dict, imdb_id: str, season: int, epi
"""Update dateadded for a specific episode""" """Update dateadded for a specific episode"""
db = dependencies["db"] db = dependencies["db"]
print(f"🔍 DEBUG: update_episode_date called with dateadded={repr(dateadded)}, source={repr(source)}")
# Get existing episode # Get existing episode
episode_data = db.get_episode_date(imdb_id, season, episode) episode_data = db.get_episode_date(imdb_id, season, episode)
if not episode_data: if not episode_data:
raise HTTPException(status_code=404, detail="Episode not found") raise HTTPException(status_code=404, detail="Episode not found")
# Handle special sources
if source == "airdate" and episode_data.get('aired'):
# Use aired date as dateadded for airdate source
aired_date = episode_data.get('aired')
if hasattr(aired_date, 'isoformat'):
dateadded = aired_date.isoformat() + "T20:00:00" # Set to 8 PM on air date
else:
dateadded = str(aired_date) + "T20:00:00"
print(f"🔍 DEBUG: Using air date as dateadded: {dateadded}")
print(f"🔍 DEBUG: Final dateadded value: {repr(dateadded)}")
# Update the date # Update the date
db.upsert_episode_date( db.upsert_episode_date(
imdb_id=imdb_id, imdb_id=imdb_id,