Fix: Properly quote tvg-id in M3U entries using %q#567
Merged
rabilrbl merged 1 commit intoJul 15, 2025
Merged
Conversation
3 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that the tvg-id attribute in generated M3U entries is properly wrapped in quotes by switching from %s to %q in the formatting string.
- Updated
fmt.Sprintfcall to use%qfortvg-idinChannelsHandler. - Manually tested playlist output and confirmed the quoted
tvg-idenables correct EPG linking.
Comments suppressed due to low confidence (2)
internal/handlers/handlers.go:416
- Consider adding a unit test for
ChannelsHandlerto assert that the generated M3U output includestvg-idwrapped in quotes, ensuring this formatting change remains covered in future modifications.
m3uContent += fmt.Sprintf("#EXTINF:-1 tvg-id=%q tvg-name=%q tvg-logo=%q tvg-language=%q tvg-type=%q group-title=%q, %s\n%s\n",
internal/handlers/handlers.go:416
- [nitpick] Using string concatenation (
+=) in a loop can lead to multiple memory reallocations; consider switching to astrings.Builderorbytes.Bufferto buildm3uContentmore efficiently.
m3uContent += fmt.Sprintf("#EXTINF:-1 tvg-id=%q tvg-name=%q tvg-logo=%q tvg-language=%q tvg-type=%q group-title=%q, %s\n%s\n",
rabilrbl
approved these changes
Jul 15, 2025
Collaborator
|
Thanks @Arshit-Singhal-Official |
3 tasks
rabilrbl
pushed a commit
that referenced
this pull request
Aug 4, 2025
rabilrbl
pushed a commit
that referenced
this pull request
Aug 4, 2025
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.
Summary
Replaces
%swith%qwhen formattingtvg-idin M3U output to ensure the attribute is properly quoted.What was the issue
tvg-id=channel123was rendered without quotesFix
%sto%qto producetvg-id="channel123"Testing
playlist.m3utvg-id="..."format