Prefer authenticated SoundCloud original downloads - #95
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughSoundCloud creator-enabled downloads now use direct downloading when yt-dlp confirms access. Otherwise, job creation keeps the existing gate flow and returns a cookie warning. The web UI displays and dismisses this warning. ChangesSoundCloud creator downloads
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant Server
participant SoundCloud
participant Ytdlp
participant WebUI
Client->>Server: Create download job
Server->>SoundCloud: Check creator download availability
Server->>Ytdlp: Verify original-download access
Ytdlp-->>Server: Return access result
Server-->>Client: Return job status and warning
Client->>WebUI: Render job response
WebUI-->>Client: Display or dismiss warning
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
webui/src/components/App.tsx (1)
610-612: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winClear
warningbefore a replacement job request.Line 611 clears
errorbut retains the previous job warning. The warning remains visible during the request and after a failed replacement request. Setwarningtonullin this update.Proposed fix
- setJob((prev) => ({ ...prev, error: null })); + setJob((prev) => ({ ...prev, warning: null, error: null }));🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@webui/src/components/App.tsx` around lines 610 - 612, Update the job state reset alongside setIsLoading and setJob so the replacement request clears both error and warning. In the setJob updater, set the existing warning field to null while preserving all other previous job fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/ytdlp.ts`:
- Line 214: Replace both rm calls in the temporary cookie cleanup flow with
Bun.file(cookiesPath).delete(). Preserve force behavior by catching and ignoring
only ENOENT errors, while propagating all other deletion failures.
---
Outside diff comments:
In `@webui/src/components/App.tsx`:
- Around line 610-612: Update the job state reset alongside setIsLoading and
setJob so the replacement request clears both error and warning. In the setJob
updater, set the existing warning field to null while preserving all other
previous job fields.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: bd4e3200-1455-4c2b-9a1a-70ba637e80d5
📒 Files selected for processing (7)
src/server.tssrc/soundcloudDownload.test.tssrc/soundcloudDownload.tssrc/ytdlp.test.tssrc/ytdlp.tswebui/src/components/App.csswebui/src/components/App.tsx
Summary
downloadformat with exported SoundCloud cookiesRoot cause
Job creation only inspected gate URLs. It did not prioritize SoundCloud's creator-enabled original download, and the API availability flags alone could not prove that the local yt-dlp session had usable authentication cookies.
Impact
Eligible tracks now skip unnecessary gates and use SoundCloud's original upload. Missing, expired, or rejected cookies no longer cause an incorrect direct-download decision, and the UI explains why the app is falling back to the gate.
Validation
bun test— 62 tests passedbun run lintbunx tsc --noEmit -p webui/tsconfig.jsongit diff --checkSummary by CodeRabbit
New Features
Bug Fixes
UI Improvements