From 0dd4333a3a2b7bc83131d7e21054d738c952d4a0 Mon Sep 17 00:00:00 2001 From: stoney420 Date: Sat, 28 Jun 2025 00:03:57 +0200 Subject: [PATCH] Update scripts/channel_processor.py --- scripts/channel_processor.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/channel_processor.py b/scripts/channel_processor.py index 26b7e3a..c9f632e 100644 --- a/scripts/channel_processor.py +++ b/scripts/channel_processor.py @@ -368,6 +368,21 @@ class ChannelProcessor: os.remove(self.config.import_file) self.logger.info("Cleaned up import file") + # CRITICAL: Save the imported channels to channels.txt + if imported_channels: + self.logger.info(f"Saving {len(imported_channels)} imported channels to file...") + + # We need to import FileManager here to avoid circular imports + from file_manager import FileManager + file_manager = FileManager(self.config) + + # Append the new channels to the file + success = file_manager.append_channels(imported_channels) + if success: + self.logger.info(f"✅ Successfully saved {len(imported_channels)} channels to {self.config.channels_file}") + else: + self.logger.error(f"❌ Failed to save imported channels to file") + self.logger.info(f"Successfully imported {len(imported_channels)} channels") return imported_channels