← Back to Pull requests

Bring photos and files home from iCloud and Google exports #145

Closed
unknown closed this pull request without merging on Nov 22, 2026 07:07 UTC
View on GitHub
unknown unknown commented on Nov 22, 2026 06:23 UTC
Author

What this does

Neither iCloud nor Google can be signed in to from Uncloud, but both will put everything an account holds into zips to download: Apple at privacy.apple.com, Google with Takeout. Add files now has an iCloud and a Google place for those zips, in place of Google Drive's "coming soon" card. People upload the zips there, into an iCloud/ or Google/ folder in My files, and what's in them is brought in as soon as they've arrived, the way Evernote's export files already are.

What arrives:

  • Photos by year. Each photo or video arrives once, in Photos/<year>/, carrying the date it was taken rather than the export date (the dates inside both exports are only when the export was made). Apple's dates come from the Photo Details*.csv beside the photos, matched only within their own part, because the same name is often a different photo in another part. Google's come from the JSON details beside each photo, in all the ways Takeout names them: .json, .supplemental-metadata.json, cut short at 51 characters, (1) moved, -edited copies, live-photo videos.

  • Albums become pages (Albums/<name>.html) that show their photos where they are, instead of a second copy of every photo. They have no scripts and the same CSP as Evernote pages. Takeout puts album photos in both the album and the year folder; they arrive once. Albums whose folder holds only details files are matched by title and date taken.

  • Drive and iCloud Drive keep their folders. iCloud Drive dates come from Drive Details.csv.

  • Deleted photos (Apple's Recently Deleted, Google's Trash) go in a folder of that name, apart from the rest.

  • Missing parts, zips from the other service, and Apple leaving photos out under Advanced Data Protection are said in the listing before anything is added.
  • How it works

  • ZipIndex reads a zip in place: its central directory (zip64 included), then each file's bytes where they lie. A 50 GB Takeout part is never unpacked first. Nothing in the zip is believed:

  • - offsets and lengths are held to the file;
    - a file never reads past the size the directory gave, which is what the room check counted;
    - each file's CRC-32 is checked as it's read, so a damaged download skips that file with a reason;
    - paths with .., NULs and symlinks are dropped.
  • ExportSource is an IImportSource over the zips in a folder, with an IExportLayout for each service: AppleExport and GoogleTakeout.

  • - Photos are keyed by size and CRC, so a photo is one photo across albums, parts and newer exports.
    - As with Evernote, a file that has arrived keeps its name, and new ones never take a name already used, so a part added later can't land on top of one already in.
  • IImportSource.KeepsDates (default false) has the engine set a file's date before moving it into place. Dropbox and host folders are unchanged.

  • Web: the Evernote follow-up is generalised to any place read from files in My files. For exports it carries on past the engine's 20,000-file cap while the last import ended with more left (importEverything, capped at 100 rounds).
  • The README's Add files section and docs/technical.md describe it. The formats come from a research pass over real exports written up from 2024–2026: immich-go, GooglePhotosTakeoutHelper, a published audit of a 72-part Apple export, and others.

    Testing

  • ZipIndexTests (10): stored and deflated entries, CRCs agree with .NET's, composed Unicode and either separator, paths that climb out, symlinks, damaged bytes, a part cut short, a non-zip, 65,540 entries (zip64), dates.

  • ExportTests (14): both layouts end to end through the real ImportService.

  • - Dates are set on the files, and same-name photos in two parts are dated separately.
    - Album pages are made, the trash is kept apart, and a later part brings only what's new as IMG_0001 2.HEIC.
    - Also covered: iCloud Drive dates, translated part names, Advanced Data Protection, wrong zips, a damaged file skipped while the rest arrive, sizes.
  • Web: the iCloud and Google panels (steps, zips only, dedupe, refusal message) and importEverything's rounds.

  • Full suites: 485 .NET and 168 web tests pass.

  • Manually, on a throwaway local server: a two-part iCloud export and a Takeout zip uploaded through the real Add files screen. Everything landed in the right year folders with the right dates, plus album pages, Drive files and Recently Deleted.
  • For the reviewer

  • No real export tested yet. Fixtures follow the documented layouts. Takeout sidecar naming is the likeliest place to miss a date; a missed photo goes in Undated (or the year Google filed it under), never lost.

  • Not handled yet:

  • - Apple's shared albums come as nested zips and arrive as those zips, unopened.
    - Memories aren't brought.
    - .tgz Takeouts aren't supported.
    - A file Takeout puts outside any zip has to be added from This device.
  • iCloud Drive dates are read as US Pacific time. That's the one real example found, and the CSV says no time zone.

  • Album pages and shared names: Apple's album spreadsheets name photos only by file name. When one name is several photos, the page shows all of them.
  • 🤖 Generated with Claude Code

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: ethanteng Review duration: 43m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #145"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%