This commit is contained in:
+9
-2
@@ -2233,16 +2233,23 @@ async def lookup_episode(imdb_id: str, season: int, episode: int, dependencies:
|
||||
Used by Emby plugin to populate missing dateadded elements in NFO files.
|
||||
"""
|
||||
try:
|
||||
print(f"DEBUG: Episode lookup called for {imdb_id} S{season:02d}E{episode:02d}")
|
||||
|
||||
db = dependencies.get("db")
|
||||
if not db:
|
||||
print(f"ERROR: Database not available in dependencies")
|
||||
raise HTTPException(status_code=500, detail="Database not available")
|
||||
|
||||
# Normalize IMDb ID (ensure tt prefix)
|
||||
if not imdb_id.startswith('tt'):
|
||||
imdb_id = f"tt{imdb_id}"
|
||||
|
||||
print(f"DEBUG: Querying database for episode {imdb_id} S{season:02d}E{episode:02d}")
|
||||
|
||||
# Query database for episode
|
||||
result = db.get_episode_data(imdb_id, season, episode)
|
||||
result = db.get_episode_date(imdb_id, season, episode)
|
||||
|
||||
print(f"DEBUG: Database query result: {result}")
|
||||
|
||||
if result and result.get('dateadded'):
|
||||
# Format response for Emby plugin
|
||||
@@ -2297,7 +2304,7 @@ async def lookup_movie(imdb_id: str, dependencies: dict):
|
||||
imdb_id = f"tt{imdb_id}"
|
||||
|
||||
# Query database for movie
|
||||
result = db.get_movie_data(imdb_id)
|
||||
result = db.get_movie_dates(imdb_id)
|
||||
|
||||
if result and result.get('dateadded'):
|
||||
# Format response for Emby plugin
|
||||
|
||||
Reference in New Issue
Block a user