Skip to content

fix: 仓库材料识别不显示结果 - #86

Open
aaa1115910 wants to merge 1 commit into
MaaAssistantArknights:masterfrom
aaa1115910:fix/depot
Open

fix: 仓库材料识别不显示结果#86
aaa1115910 wants to merge 1 commit into
MaaAssistantArknights:masterfrom
aaa1115910:fix/depot

Conversation

@aaa1115910

@aaa1115910 aaa1115910 commented Apr 22, 2026

Copy link
Copy Markdown

修复因 MaaAssistantArknights/MaaAssistantArknights#15358 仓库识别结构变更导致仓库材料识别不显示结果

fix #82

Summary by Sourcery

更新仓库(depot)模型和导出方式,以适配新的后端结构,并恢复材料识别输出。

Bug 修复:

  • 修复后端结构变更后,仓库材料识别结果不再显示的问题。

增强内容:

  • MAADepot 数据结构简化为扁平的 JSON 字符串,并在需要时从中派生 arkplanner / lolicon 导出数据。
Original summary in English

Summary by Sourcery

Update depot model and exports to align with new backend structure and restore material recognition output.

Bug Fixes:

  • Fix depot material recognition not displaying results after backend structure changes.

Enhancements:

  • Simplify MAADepot data structure to a flat JSON string and derive arkplanner/lolicon exports on demand from it.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些总体反馈:

  • data 解码 JSON 为 [String: Int] 的逻辑在 contentsarkPlannerExportTextloliconExportText 中都有重复;建议抽取成一个单独的辅助函数或计算属性,以避免重复并保持解码逻辑的一致性。
  • arkPlannerExportTextloliconExportText 在任何解码/序列化错误时都会返回空字符串,而这个空字符串仍会被复制到剪贴板;建议改为返回可选的 String 或将错误向上抛出,这样 UI 就可以禁用按钮或显示失败状态,而不是静默复制一个空值。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- The JSON decoding from `data` into `[String: Int]` is duplicated in `contents`, `arkPlannerExportText`, and `loliconExportText`; consider extracting this into a single helper/computed property to avoid repetition and keep the decoding logic consistent.
- Both `arkPlannerExportText` and `loliconExportText` return an empty string on any decoding/serialization error, which will still be copied to the clipboard; consider returning an optional `String` or surfacing the error so the UI can disable the buttons or show a failure state instead of silently copying an empty value.

Sourcery 对开源项目免费——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English

Hey - I've left some high level feedback:

  • The JSON decoding from data into [String: Int] is duplicated in contents, arkPlannerExportText, and loliconExportText; consider extracting this into a single helper/computed property to avoid repetition and keep the decoding logic consistent.
  • Both arkPlannerExportText and loliconExportText return an empty string on any decoding/serialization error, which will still be copied to the clipboard; consider returning an optional String or surfacing the error so the UI can disable the buttons or show a failure state instead of silently copying an empty value.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The JSON decoding from `data` into `[String: Int]` is duplicated in `contents`, `arkPlannerExportText`, and `loliconExportText`; consider extracting this into a single helper/computed property to avoid repetition and keep the decoding logic consistent.
- Both `arkPlannerExportText` and `loliconExportText` return an empty string on any decoding/serialization error, which will still be copied to the clipboard; consider returning an optional `String` or surfacing the error so the UI can disable the buttons or show a failure state instead of silently copying an empty value.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

仓库识别功能出错

1 participant