Skip to content

feat(media): 支援跨平台相機媒體上傳 - #123

Merged
js051 merged 3 commits into
mainfrom
feat/cross-platform-media-upload
Aug 9, 2026
Merged

feat(media): 支援跨平台相機媒體上傳#123
js051 merged 3 commits into
mainfrom
feat/cross-platform-media-upload

Conversation

@js051

@js051 js051 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

變更內容

  • 建立共享 MEDIA_UPLOAD 能力、資料模型、repository 與 backend 合約。
  • Android USB 以標準 PTP SendObjectInfo / SendObject 上傳,並加入 SAF 暫存、儲存裝置與格式能力判斷、重名防護、完整 readback 驗證及取消後狀態調和。
  • Desktop Bridge 以 gPhoto2 上傳,限制檔名、MIME、大小與 subprocess 輸出,支援斷線取消及大小寫不敏感的 FAT/exFAT 重名檢查。
  • Android、iOS 與 PC UI 加入能力導向的檔案選擇、進度、取消、成功與錯誤狀態;直接 CCAPI 相機上傳仍明確標示為不支援。
  • Simulator 新增具相同限制的媒體上傳端點、原子重名檢查與 payload 生命週期管理。
  • 補齊英文、繁中、協定文件、功能狀態、參考依據與變更紀錄。

設計重點

相機只有在實際公告必要 PTP/gPhoto2 能力、具可寫入儲存空間且接受檔案格式時,才會顯示上傳功能。資料傳送成功後會重新讀取媒體列表,以檔名與精確大小確認提交結果;取消恰好發生在相機提交邊界時,也會重新調和狀態,避免把已完成的上傳誤報為取消。

驗證

  • Android: testDebugUnitTest compileDebugAndroidTestKotlin lintDebug assembleDebug
  • Bridge: pytest、Ruff
  • Simulator: 44 項 pytest、Ruff
  • PC Web: Node module tests、Playwright browser tests、node --checknpm audit
  • Validation: 20 項 unittest、Ruff
  • Gitleaks: 完整歷史、staged diff、pre-push 均為 0 leaks
  • GitHub Actions: Android API 34/36、iOS Core/App UI、Bridge、Windows bundle、Simulator、Secret Scan 共 9 jobs 全數通過
  • git diff --check

真機驗證狀態

Canon EOS R6 Mark III 的 USB 媒體上傳、取消邊界與精確 readback 仍須實體相機確認。合併只代表 executable path 與自動測試達到 main 的工程門檻;在提交實體證據前,不會把該機型標記為已驗證支援。

@js051
js051 marked this pull request as ready for review August 9, 2026 16:54
@js051
js051 merged commit 6ac0bc3 into main Aug 9, 2026
9 checks passed
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