db: more sb improvments
Local Docker Build (Dev) / build-dev (push) Successful in 4s

This commit is contained in:
2025-10-18 09:27:15 -04:00
parent 6ef1d2fd89
commit cb18c358c6
2 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -1 +1 @@
2.3.7 2.3.8
+12 -3
View File
@@ -699,11 +699,14 @@ class NFOManager:
# Dates at the end # Dates at the end
if aired: if aired:
aired_elem = ET.SubElement(episode, "aired") aired_elem = ET.SubElement(episode, "aired")
aired_elem.text = aired[:10] if len(aired) >= 10 else aired # Convert datetime objects to strings
aired_str = str(aired)
aired_elem.text = aired_str[:10] if len(aired_str) >= 10 else aired_str
if dateadded: if dateadded:
dateadded_elem = ET.SubElement(episode, "dateadded") dateadded_elem = ET.SubElement(episode, "dateadded")
dateadded_elem.text = dateadded # Convert datetime objects to strings
dateadded_elem.text = str(dateadded)
# Add lockdata at the very end # Add lockdata at the very end
if lock_metadata: if lock_metadata:
@@ -735,9 +738,15 @@ class NFOManager:
except Exception as e: except Exception as e:
print(f"❌ Error creating/updating episode NFO {nfo_path}: {e}") print(f"❌ Error creating/updating episode NFO {nfo_path}: {e}")
def set_file_mtime(self, file_path: Path, iso_timestamp: str) -> None: def set_file_mtime(self, file_path: Path, iso_timestamp) -> None:
"""Set file modification time to match import date""" """Set file modification time to match import date"""
try: try:
# Convert datetime objects to strings first
if hasattr(iso_timestamp, 'isoformat'):
iso_timestamp = iso_timestamp.isoformat()
elif not isinstance(iso_timestamp, str):
iso_timestamp = str(iso_timestamp)
# Parse ISO timestamp # Parse ISO timestamp
if iso_timestamp.endswith('Z'): if iso_timestamp.endswith('Z'):
dt = datetime.fromisoformat(iso_timestamp.replace('Z', '+00:00')) dt = datetime.fromisoformat(iso_timestamp.replace('Z', '+00:00'))