From 197a81d8fb06295774678588a6e997331af919d9 Mon Sep 17 00:00:00 2001 From: Wendell Jones Date: Tue, 9 Dec 2025 16:28:35 -0500 Subject: [PATCH] Refactor dbmongo class to improve code structure and readability --- db/functions.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/db/functions.py b/db/functions.py index efc6677..b0195dc 100644 --- a/db/functions.py +++ b/db/functions.py @@ -615,9 +615,18 @@ class dbmongo(object): if isinstance(fcount, int): crew_failed_count = crew_failed_count + fcount else: - for crew in fcount: - self.insert_or_update_mongo( - self.mgcrew, crew, "id" + try: + for crew in fcount: + self.insert_or_update_mongo( + self.mgcrew, crew, "id" + ) + except Exception as e: + lprint.logprint( + "info", + ( + f"Unable to insert crew data for seriesid " + f"{seriesid}. {e}" + ), ) print(f"Processing complete. {processed_count} series processed.") print(f"Failed to load {series_failed_count} series files.")