diff --git a/VERSION b/VERSION index f225a78..aedc15b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.5.2 +2.5.3 diff --git a/api/web_routes.py b/api/web_routes.py index 5a0accc..6f906c7 100644 --- a/api/web_routes.py +++ b/api/web_routes.py @@ -854,8 +854,9 @@ async def get_movie_date_options(dependencies: dict, imdb_id: str): datetime.fromisoformat(release_date.replace('Z', '+00:00')) # Only add if it's different from current dateadded - current_dateadded = movie.get('dateadded', '') - if not current_dateadded or not current_dateadded.startswith(released_raw[:10]): # Compare just the date part + current_dateadded = movie.get('dateadded') + current_date_str = current_dateadded.strftime('%Y-%m-%d') if current_dateadded else '' + if not current_dateadded or not current_date_str.startswith(released_raw[:10]): # Compare just the date part options.append({ "type": "digital_release", "label": "Use Actual Release Date", @@ -893,8 +894,9 @@ async def get_movie_date_options(dependencies: dict, imdb_id: str): import_date, source = movie_processor.radarr.get_movie_import_date(movie_id, fallback_to_file_date=True) if import_date and source != "no_valid_date_source": # Check if this is different from current date - current_dateadded = movie.get('dateadded', '') - if not current_dateadded or not current_dateadded.startswith(import_date[:10]): + current_dateadded = movie.get('dateadded') + current_date_str = current_dateadded.strftime('%Y-%m-%d') if current_dateadded else '' + if not current_dateadded or not current_date_str.startswith(import_date[:10]): options.append({ "type": "radarr_import", "label": f"Radarr Import Date ({source})", @@ -911,8 +913,9 @@ async def get_movie_date_options(dependencies: dict, imdb_id: str): digital_release = external_clients.tmdb.get_digital_release_date(imdb_id) if digital_release: # Check if this is different from current date - current_dateadded = movie.get('dateadded', '') - if not current_dateadded or not current_dateadded.startswith(digital_release[:10]): + current_dateadded = movie.get('dateadded') + current_date_str = current_dateadded.strftime('%Y-%m-%d') if current_dateadded else '' + if not current_dateadded or not current_date_str.startswith(digital_release[:10]): options.append({ "type": "tmdb_digital", "label": "TMDB Digital Release", @@ -935,8 +938,9 @@ async def get_movie_date_options(dependencies: dict, imdb_id: str): omdb_iso = omdb_date.strftime('%Y-%m-%d') # Check if this is different from current date - current_dateadded = movie.get('dateadded', '') - if not current_dateadded or not current_dateadded.startswith(omdb_iso): + current_dateadded = movie.get('dateadded') + current_date_str = current_dateadded.strftime('%Y-%m-%d') if current_dateadded else '' + if not current_dateadded or not current_date_str.startswith(omdb_iso): options.append({ "type": "omdb_release", "label": "OMDb Release Date", @@ -1123,8 +1127,9 @@ async def get_episode_date_options(dependencies: dict, imdb_id: str, season: int if import_date: # Check if this is different from current date - current_dateadded = episode_data.get('dateadded', '') - if not current_dateadded or not current_dateadded.startswith(import_date[:10]): + current_dateadded = episode_data.get('dateadded') + current_date_str = current_dateadded.strftime('%Y-%m-%d') if current_dateadded else '' + if not current_dateadded or not current_date_str.startswith(import_date[:10]): options.append({ "type": "sonarr_import", "label": "Sonarr Import Date", diff --git a/core/database.py b/core/database.py index 7f8237e..b64c2d8 100644 --- a/core/database.py +++ b/core/database.py @@ -434,9 +434,10 @@ class NFOGuardDatabase: """Add processing history entry""" with self.get_connection() as conn: cursor = conn.cursor() - cursor.execute(""" + placeholder = self._get_placeholder() + cursor.execute(f""" INSERT INTO processing_history (imdb_id, media_type, event_type, processed_at, details) - VALUES (?, ?, ?, ?, ?) + VALUES ({placeholder}, {placeholder}, {placeholder}, {placeholder}, {placeholder}) """, (imdb_id, media_type, event_type, datetime.utcnow().isoformat(), json.dumps(details) if details else None))