BlueHuskyStudios / BlueHuskyStudios/DeadassSimpleMediaPlayer
Folder import makes two sequential passes over every file
- Dominant language
- Swift
- Stars
- 0
- Forks
- 3
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 9
Description
`Playlist.entries(fromUrl:)` builds entries through `.async.compactMap { await MediaItem(url:) }`, which is strictly sequential. Then `autoSorted()` loops again, sequentially awaiting three metadata keys per entry.
Each `MediaItem(url:)` additionally creates a bookmark *and then immediately resolves it* (the standalone-access trade-up), so it's two filesystem round-trips per file before metadata even starts.
At a measured ~16ms/file (iPhone 15 Pro Max), 500 files is ~8 seconds. A `TaskGroup` with order reassembly would cut this substantially; it's the single biggest lever on import time.
Contributor guide
Research direction
Start at Playlist.entries(fromUrl:), MediaItem(url:), and autoSorted() to trace the two sequential passes and bookmark resolution. Evaluate TaskGroup-based order reassembly while preserving entry order, then measure importing 500 files to confirm the sequential import time is substantially reduced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100