Materialize cloud-provider files (Google Drive) on local import [stacked on #112] - #113
Merged
Conversation
…ocal import Files picked from cloud file providers often arrive as unmaterialized placeholders, so the direct copyItem into the audio cache fails. Retry the copy through NSFileCoordinator: the coordinated read tells the provider to download the real bytes (blocking off-main while it fetches), after which the normal import path proceeds. Makes the upload button work with Google Drive and other Files-app providers, not just on-device storage. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013TJoWkqg8bzkGdzxWhWjWP
sanylax0
merged commit Jul 20, 2026
d4763f6
into
claude/repo-review-improvements-yvk3t7-local-files
1 check passed
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.
Stacked on #112 (base = its branch; merge #112 first, then retarget/merge this).
What
The upload (+↑) button's Files picker already lists Google Drive as a source once the Drive app is installed and enabled in the Files app — iOS document pickers surface every file provider, no Google SDK/OAuth needed.
What didn't work reliably: cloud picks often arrive as unmaterialized placeholders (the bytes are still in the cloud), and the direct
copyIteminto the audio cache fails on those. This PR retries the copy throughNSFileCoordinator— a coordinated read instructs the provider to download the real file (blocking off-main while it fetches), then the normal import path (metadata, artwork, "Local Files" playlist, analysis) proceeds unchanged.Covers Google Drive, iCloud Drive, Dropbox, and any other Files-app provider.
Known limitation
Whole-folder scanning works best for on-device/iCloud folders. Some providers (Drive included) don't expose folder enumeration to the picker or return placeholder sizes; picking individual songs (multi-select works) is the dependable path for Drive.
Device checks
🤖 Generated with Claude Code
https://claude.ai/code/session_013TJoWkqg8bzkGdzxWhWjWP
Generated by Claude Code