Skip to content

fix: podcast add to library#76

Merged
sozercan merged 2 commits intomainfrom
fix-podcast-library
Jan 16, 2026
Merged

fix: podcast add to library#76
sozercan merged 2 commits intomainfrom
fix-podcast-library

Conversation

@sozercan
Copy link
Owner

@sozercan sozercan commented Jan 16, 2026

Description

fixes #61

AI Prompt (Optional)

🤖 AI Prompt Used
<!-- Paste your prompt here, or write "N/A - Manual implementation" -->

AI Tool:

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📚 Documentation update
  • 🎨 UI/UX improvement
  • ♻️ Refactoring (no functional changes)
  • 🧪 Test update
  • 🔧 Build/CI configuration

Related Issues

Changes Made

Testing

  • Unit tests pass (xcodebuild test -only-testing:KasetTests)
  • Manual testing performed
  • UI tested on macOS 26+

Checklist

  • My code follows the project's style guidelines
  • I have run swiftlint --strict && swiftformat .
  • I have added tests that prove my fix/feature works
  • New and existing unit tests pass locally
  • I have updated documentation if needed
  • I have checked for any performance implications
  • My changes generate no new warnings

Screenshots

Additional Notes

Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
Copilot AI review requested due to automatic review settings January 16, 2026 19:27
@sozercan sozercan merged commit f82facc into main Jan 16, 2026
10 checks passed
@sozercan sozercan deleted the fix-podcast-library branch January 16, 2026 19:29
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: podcast "add to library" does not work

2 participants