fix: support Telegram Desktop full exports (#188) - #226
Open
Yu-0312 wants to merge 1 commit into
Open
Conversation
审查者指南新增对 Telegram Desktop 完整导出(chats.list)的支持,同时保持与单独聊天导出的兼容性,并为两种导出格式引入回归测试。解析器现在会遍历完整导出中的聊天,将聊天元数据规范化为安全的路径组件,并为每个聊天创建单独的 CSV 输出文件。 Telegram 导出处理的时序图sequenceDiagram
participant Export as TelegramExport
participant Processor as process_telegram_dataset
participant Iterator as _iter_export_chats
participant Parser as TelegramChatParser
participant CSV as CSVOutput
Export->>Processor: load result.json
Processor->>Iterator: _iter_export_chats(jdata)
alt full export
Iterator-->>Processor: chats.list chat objects
else individual chat export
Iterator-->>Processor: top-level chat object
end
loop each chat
Processor->>Parser: process_chat(chat_data)
Parser-->>Processor: messages
Processor->>CSV: to_csv(messages, csv_file_path)
Processor->>Parser: copy_received_images(messages, folder_path)
end
文件级变更
针对关联 Issue 的评估
可能关联的 Issue
提示和命令与 Sourcery 交互
自定义使用体验访问你的 仪表板:
获取帮助Original review guide in EnglishReviewer's GuideAdds support for Telegram Desktop full exports (chats.list) to the Telegram parser while maintaining compatibility with single-chat exports, and introduces regression tests for both export formats. The parser now iterates chats within a full export, normalizes chat metadata into safe path components, and creates separate CSV outputs per chat. Sequence diagram for Telegram export processingsequenceDiagram
participant Export as TelegramExport
participant Processor as process_telegram_dataset
participant Iterator as _iter_export_chats
participant Parser as TelegramChatParser
participant CSV as CSVOutput
Export->>Processor: load result.json
Processor->>Iterator: _iter_export_chats(jdata)
alt full export
Iterator-->>Processor: chats.list chat objects
else individual chat export
Iterator-->>Processor: top-level chat object
end
loop each chat
Processor->>Parser: process_chat(chat_data)
Parser-->>Processor: messages
Processor->>CSV: to_csv(messages, csv_file_path)
Processor->>Parser: copy_received_images(messages, folder_path)
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #188. Support Telegram Desktop full exports with chats.list while preserving compatibility with individual chat exports. Add regression tests for both formats.
Sourcery 摘要
支持 Telegram Desktop 完整导出和单个聊天导出,并为每个聊天生成独立的 CSV 数据集。
新功能:
chats.list中。增强功能:
测试:
Original summary in English
Summary by Sourcery
Support both Telegram Desktop full exports and individual chat exports while producing separate CSV datasets for each chat.
New Features:
chats.list.Enhancements:
Tests: