This commit is contained in:
+15
-10
@@ -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",
|
||||
|
||||
+3
-2
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user