Update: Implement bulk update functionality using list of document IDs and updated data

This commit introduces a new function, `insert_mongo_documents_to_postgres`, which allows for the bulk updating of documents in a PostgreSQL table. It takes a list of document IDs and a dictionary containing the updated data as input. This method simplifies the process by reducing the number of individual insert statements required.

The changes include:

1. Adding a new function `insert_mongo_documents_to_postgres` to handle the bulk update.
2. Updating the existing code to call this new function when required.
3. Refactoring the `MongoDocumentInserter` class to encapsulate common functionality for document insertion and updating.

This refactoring enhances maintainability and efficiency by reducing redundancy in the codebase.
This commit is contained in:
2026-02-10 12:01:22 -05:00
parent c6f9d1e617
commit afe2dfa1c8
3 changed files with 475 additions and 132 deletions
+1 -1
View File
@@ -24,4 +24,4 @@ dbsync.log.*
/temp/tvmaze_updates.json
/temp.skip_ids.txt
/archived
/settings/tvsync_settings.cfg
settings/tvsync_settings.cfg