feat: Add YouTube API key testing in Settings#47
Merged
salvageop merged 4 commits intoJun 18, 2026
Conversation
Allow users to test their YouTube API key directly from the settings page by clicking a button. Uses a LiveView component that provides visual feedback on whether the key is valid. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add missing test_api_key/1 callback to YoutubeRss module (RSS doesn't use API keys, so it returns :ok) and fix formatting in YoutubeApi. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The previous test_api_key/1 tried to decode YouTube's JSON error body, but
HTTPClient.get/3 only returns the body on HTTP 200 and returns {:error, reason}
for any other status, so the error-parsing branches were unreachable. Simplify
to treat a 200 as a valid key and pass the client's status-coded reason through
on failure. Move the test playlist id to a module attribute and add tests for
test_api_key/1 on both the API and RSS clients.
Collaborator
|
Hi @profesorabbott , thank you for the contribution! I added a few tests and removed some dead code portion (HTTPClient.get/3 throws away the response body on any non-200 and returns {:error, "HTTP request failed with status code 403: ..."}) and merged it. Looks good! I'll release once I check your other PRs |
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.
What's new?
Allow users to test their YouTube API key directly from the settings page.
What's changed?
Uses a LiveView component that provides visual feedback on whether the key is valid.
What's fixed?
N/A
Other Notes
Copied from PR Add YouTube API key testing in settings from the original branch