Move user listening logic to new client#7
Merged
VoxSecundus merged 7 commits intomainfrom Aug 24, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the user listening logic by extracting it from the UserClient into a new ListenClient class, creating better separation of concerns. The refactoring introduces a shared AuthenticatableClient base class to handle common authentication functionality.
- Extracted listen-related methods from UserClient to a new ListenClient class
- Created AuthenticatableClient base class for shared authentication logic
- Updated tests to reflect the new client structure and improved Response class handling
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/overhear/clients/authenticatable_client.rb | New base class handling authentication logic shared between client classes |
| lib/overhear/clients/user_client.rb | Refactored to inherit from AuthenticatableClient, now only handles now_playing functionality |
| lib/overhear/clients/listen_client.rb | New client class containing listen-related methods (listen_count, listens) |
| test/test_listen_client.rb | New test file for ListenClient functionality |
| test/test_user_client.rb | Updated tests to focus on UserClient's remaining functionality |
| test/test_helper.rb | Added Response class for consistent test mocking |
| sig/overhear.rbs | Updated type signatures to reflect new class hierarchy |
| lib/overhear.rb | Added require statements for new client classes |
| lib/overhear/clients/client.rb | Fixed URL joining using URI.join |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
No description provided.