-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle width and height placeholders in the thumbnail URL #136227
Conversation
Update the stream_picture logic to remove the {width}x{height} placeholder from the thumbnail_url. The current thumbnail_url returned by the Twitch API requires {width}x{height} to be set.
Hey there @joostlek, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One query. Also, ideally a test should be added to verify correct behavior.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
The Twitch API does not work with the placeholders {width} and {height} still present in the URL. The API accepts both values set as empty strings, and interprets this as a request for the maximum resolution image. Therefore we modify ".../username-{width}x{height}.jpg" into ".../username-x.jpg", in order to avoid an error. In future we may allow width & height to be specified via configuration parameters. The code is updated to reflect this intent even though there is no way of configuring it yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @Makrit 👍
../Frenck
Proposed change
The Twitch API does not work with the placeholders
{width
} and{height}
still present in the URL.The API accepts both values set as empty strings, and interprets this as a request for the maximum resolution image. Therefore we modify
".../username-{width}x{height}.jpg"
into".../username-x.jpg"
, in order to avoid an error.Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: