Conversation
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
There was a problem hiding this comment.
Pull request overview
This pull request fixes a critical bug in podcast subscription functionality where podcast show IDs were incorrectly converted to playlist IDs, causing HTTP 404 errors. The bug involved creating a double-L prefix (PLLXz2p9...) instead of the correct single-L prefix (PLXz2p9...).
Changes:
- Fixed podcast show ID to playlist ID conversion by correctly stripping "MPSPP" and prepending "P" instead of "PL"
- Added comprehensive validation for podcast ID format with proper error handling
- Improved UI updates by synchronizing LibraryViewModel when subscribing/unsubscribing to podcasts
- Refactored IntelligenceModifier to use SwiftUI's Observation framework instead of manual notification handling
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
docs/api-discovery.md |
Added comprehensive documentation of podcast ID format, conversion logic, and the double-L bug with validation requirements |
Core/Services/API/YTMusicClient.swift |
Extracted conversion logic to convertPodcastShowIdToPlaylistId method with proper validation (empty suffix, L-prefix check) |
Views/macOS/PodcastsView.swift |
Added error alert display and LibraryViewModel synchronization for immediate UI updates after subscription changes |
Core/ViewModels/LibraryViewModel.swift |
Added addToLibrary(podcast:) and removeFromLibrary(podcastId:) methods to update both ID set and shows array |
Core/Utilities/IntelligenceModifier.swift |
Refactored to use computed property reading from @observable service instead of @State with notification listener |
Tests/KasetTests/YTMusicClientTests.swift |
Added comprehensive tests for ID conversion, double-L bug prevention, and validation error cases |
Tests/KasetTests/LibraryViewModelTests.swift |
Added tests for podcast library operations (add, remove, duplicate prevention, existence checks) |
Tests/KasetTests/Helpers/MockYTMusicClient.swift |
Added validation logic to mock client to mirror real implementation behavior for testing |
Tests/KasetTests/Helpers/TestFixtures.swift |
Added makePodcastShow fixture factory with valid MPSPP ID format |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
fixes #61
AI Prompt (Optional)
🤖 AI Prompt Used
AI Tool:
Type of Change
Related Issues
Changes Made
Testing
xcodebuild test -only-testing:KasetTests)Checklist
swiftlint --strict && swiftformat .Screenshots
Additional Notes