From 4168d07118635a0e307e68122a10f1abf4648db4 Mon Sep 17 00:00:00 2001 From: terrtia Date: Tue, 6 Feb 2024 11:13:45 +0100 Subject: [PATCH] fix: [chats] fix chats image importer --- bin/importer/feeders/Default.py | 3 ++- bin/lib/objects/ChatThreads.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/importer/feeders/Default.py b/bin/importer/feeders/Default.py index 25b3d13b..ca0861a1 100755 --- a/bin/importer/feeders/Default.py +++ b/bin/importer/feeders/Default.py @@ -63,7 +63,8 @@ class DefaultFeeder: return self.json_data.get('data') def get_obj_type(self): - return self.json_data.get('type', 'item') + meta = self.get_json_meta() + return meta.get('type', 'item') ## OVERWRITE ME ## def get_obj(self): diff --git a/bin/lib/objects/ChatThreads.py b/bin/lib/objects/ChatThreads.py index 0609faab..a2559cc4 100755 --- a/bin/lib/objects/ChatThreads.py +++ b/bin/lib/objects/ChatThreads.py @@ -106,7 +106,7 @@ def create(thread_id, chat_instance, chat_id, subchannel_id, message_id, contain new_thread_id = f'{chat_id}/{subchannel_id}/{thread_id}' thread = ChatThread(new_thread_id, chat_instance) - if not thread.exists(): + if not thread.is_children(): thread.create(container_obj, message_id) return thread