feat: channelThumbnailWidth to allow for full-size channel thumbnails#85
Open
JCBird1012 wants to merge 2 commits intojef:mainfrom
Open
feat: channelThumbnailWidth to allow for full-size channel thumbnails#85JCBird1012 wants to merge 2 commits intojef:mainfrom
JCBird1012 wants to merge 2 commits intojef:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new channelThumbnailWidth configuration option that allows users to control the width of channel thumbnail images in the generated XMLTV output. Users can specify a custom width in pixels, set it to 0 to remove the width parameter entirely for full-size images, or leave it unset to use the API's default width (~55 pixels).
Key changes:
- Added
XmltvOptionstype withchannelThumbnailWidthfield for configuring thumbnail width - Enhanced
buildChannelsXmlandbuildXmltvfunctions to accept and apply width options via URL query parameter manipulation - Implemented configuration parsing in
getConfig()that handles both environment variables and CLI arguments with proper validation
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/xmltv.ts | Introduces XmltvOptions type and modifies buildChannelsXml and buildXmltv to accept options; implements URL query parameter logic for controlling thumbnail width |
| src/xmltv.test.ts | Adds test cases to verify the thumbnail width option works correctly with custom values and zero value |
| src/index.ts | Updates help text formatting and passes the channelThumbnailWidth option from config to buildXmltv |
| src/config.ts | Adds configuration parsing for channelThumbnailWidth from environment variables and CLI arguments with NaN validation |
| README.md | Documents the new CHANNEL_THUMBNAIL_WIDTH environment variable and --channelThumbnailWidth CLI argument in the configuration tables |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ec2a96e to
769b733
Compare
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.
This allows users to specify the width of the channel thumbnail for higher resolution channel logos. Right now, we're using the API default of 55px, but we can download the full resolution thumbnail by omitting the width parameter entirely. I didn't want to make that the default due to increased API load/bandwidth (and it also means slightly longer image load times for downstream consumers of the XMLTV file).
Additional tests
> should honor channel thumbnail width optionand> should remove width when option is zerowere added inxmltv.test.ts