Skip to content

feat: add artists to library#116

Open
sozercan wants to merge 1 commit intomainfrom
feat/library-artists
Open

feat: add artists to library#116
sozercan wants to merge 1 commit intomainfrom
feat/library-artists

Conversation

@sozercan
Copy link
Owner

Adds Artists section to the Library, allowing users to browse their subscribed/followed artists from YouTube Music.

Closes #60

Adds subscribed/followed artists to the Library view, closing GitHub issue #60.

- Add `getLibraryArtists()` to `YTMusicClientProtocol` and `YTMusicClient`
  - Fetches from `FEmusic_library_corpus_track_artists` (the filter chip endpoint
    from `FEmusic_library_landing`, no extra params required)
- Extend `PlaylistParser.LibraryContent` with `artists: [Artist]` field
  - `parseLibraryContent` now classifies `UC*` browse IDs as artists
  - Add `parseLibraryArtists(_:)` for the dedicated artists endpoint
- Update `LibraryViewModel` to fetch artists in parallel with library content
  - Add `artists: [Artist]`, `libraryArtistIds: Set<String>`
  - Add `addToLibrary(artist:)`, `removeFromLibrary(artistId:)`, `isInLibrary(artistId:)`
- Update `LibraryView` with:
  - New `artists` case in `LibraryFilter` enum (between Playlists and Podcasts)
  - `artistCard()` view (circular thumbnail, artist name, Artist subtitle)
  - `navigationDestination(for: Artist.self)` to ArtistDetailView
  - Updated empty-state messages for the artists filter
- Update `MockYTMusicClient` and `MockUITestYTMusicClient` with `getLibraryArtists()`
- Add comprehensive artist library tests to `LibraryViewModelTests`

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 25, 2026 08:14
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 PR adds support for displaying subscribed/followed artists in the Library view, addressing issue #60. The implementation adds a new "Artists" filter to the Library view and fetches artist data from YouTube Music's dedicated library artists endpoint.

Changes:

  • Added "Artists" filter option to Library view with circular thumbnails and dedicated empty states
  • Implemented artist fetching via new getLibraryArtists() API method using FEmusic_library_corpus_track_artists endpoint
  • Added comprehensive test coverage for artist library operations (add, remove, check, refresh)

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Views/macOS/LibraryView.swift Added Artists filter, navigation destination, artist card UI, and updated LibraryItem enum to include artists
Core/ViewModels/LibraryViewModel.swift Added artist state management properties and methods (addToLibrary, removeFromLibrary, isInLibrary) with concurrent fetching
Core/Services/API/YTMusicClient.swift Implemented getLibraryArtists() method to fetch from FEmusic_library_corpus_track_artists endpoint
Core/Services/API/Parsers/PlaylistParser.swift Added parseLibraryArtists() parser and updated LibraryContent struct (though artists from getLibraryContent are unused)
Core/Services/Protocols.swift Added getLibraryArtists() method to YTMusicClientProtocol
Tests/KasetTests/LibraryViewModelTests.swift Added 9 comprehensive tests for artist library functionality
Tests/KasetTests/Helpers/MockYTMusicClient.swift Implemented mock support for getLibraryArtists()
Core/Services/API/MockUITestYTMusicClient.swift Implemented mock support for getLibraryArtists() for UI tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

struct LibraryContent {
let playlists: [Playlist]
let podcastShows: [PodcastShow]
let artists: [Artist]
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The artist parsing logic added to parseLibraryContent and its helper functions is never used since the LibraryViewModel only uses artists from getLibraryArtists() (line 137 in LibraryViewModel.swift sets self.artists = fetchedArtists, ignoring content.artists). Consider either using content.artists or removing the artist parsing logic from parseLibraryContent(), parseLibraryItem(), and parseLibraryItemFromResponsive() to avoid unnecessary computation and maintain clarity about which data sources are actually used.

Copilot uses AI. Check for mistakes.
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.

[Feature]: artists are missing in library

2 participants