Skip to content

Conversation

@JCBird1012
Copy link

@JCBird1012 JCBird1012 commented Dec 4, 2025

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 option and > should remove width when option is zero were added in xmltv.test.ts

@JCBird1012 JCBird1012 requested a review from jef as a code owner December 4, 2025 23:17
Copilot AI review requested due to automatic review settings December 4, 2025 23:17
Copilot finished reviewing on behalf of JCBird1012 December 4, 2025 23:19
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 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 XmltvOptions type with channelThumbnailWidth field for configuring thumbnail width
  • Enhanced buildChannelsXml and buildXmltv functions 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.

JCBird1012 and others added 2 commits December 4, 2025 19:13
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.

1 participant