From 8df312f3f2bf7345d79444b4af65c73bde7fcfdc Mon Sep 17 00:00:00 2001 From: Diego Rivera Date: Mon, 28 Nov 2022 14:49:40 -0600 Subject: [PATCH 1/4] Adapted from papaschloss * support non-numeric channels --- CHANGELOG.md | 4 ++++ plex.go | 2 +- tvheadenv.go | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6381c7..463cbf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v1.0.2 - 2022-11-28 + +* Fix to support string-formatted channel numbers (from papaschloss) + ## v1.0.1 - 2017-11-29 * Update golang to 1.9.3 [Will Boyce] diff --git a/plex.go b/plex.go index fbe1d30..1b376b2 100644 --- a/plex.go +++ b/plex.go @@ -76,7 +76,7 @@ func (p *plexHeadend) lineupHandler(w http.ResponseWriter, r *http.Request) { for _, channel := range p.tvhGetChannels() { if p.tag == "" || sliceContains(channel.Tags, p.tag) { data = append(data, - lineupResponse{fmt.Sprintf("%d", channel.Number), channel.Name, channel.URL}) + lineupResponse{fmt.Sprintf("%s", channel.Number), channel.Name, channel.URL}) } } json.NewEncoder(w).Encode(data) diff --git a/tvheadenv.go b/tvheadenv.go index 68c92c4..7042ef1 100644 --- a/tvheadenv.go +++ b/tvheadenv.go @@ -39,7 +39,7 @@ type apiChannelsResponse struct { type apiChannel struct { UUID string `json:"uuid"` Name string `json:"name"` - Number int `json:"number"` + Number string `json:"number"` Tags []string `json:"tags"` URL string `json:"url"` } From 1871c73ef0a33e94107b4ac36b091fe8f3d64d9f Mon Sep 17 00:00:00 2001 From: Diego Rivera Date: Mon, 28 Nov 2022 15:11:00 -0600 Subject: [PATCH 2/4] Updated README.md to describe the added functionality --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4bba3a9..dd45555 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/wrboyce/plexheadend)](https://goreportcard.com/report/github.com/wrboyce/plexheadend) [![CircleCI](https://circleci.com/gh/wrboyce/plexheadend.png?style=shield)](https://circleci.com/gh/wrboyce/plexheadend) -Proxy requests between PlexDVR and TVHeadend +Proxy requests between PlexDVR and TVHeadend. Now supports non-numeric channel numbers (i.e. "21.1"). ## Installation @@ -86,4 +86,4 @@ services: - 32400:32400 - 32400:32400/udp restart: unless-stopped -``` \ No newline at end of file +``` From 8c75a53f14e59176dc9f030ab747634c5a7a0e0e Mon Sep 17 00:00:00 2001 From: Diego Rivera Date: Mon, 28 Nov 2022 15:11:32 -0600 Subject: [PATCH 3/4] Attribute the changes properly --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dd45555..aa01661 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/wrboyce/plexheadend)](https://goreportcard.com/report/github.com/wrboyce/plexheadend) [![CircleCI](https://circleci.com/gh/wrboyce/plexheadend.png?style=shield)](https://circleci.com/gh/wrboyce/plexheadend) -Proxy requests between PlexDVR and TVHeadend. Now supports non-numeric channel numbers (i.e. "21.1"). +Proxy requests between PlexDVR and TVHeadend. Now supports non-numeric channel numbers (i.e. "21.1", per changes by papaschloss). ## Installation From 83bf3f0a6969c4f062acdaa932e84a1d965a56dd Mon Sep 17 00:00:00 2001 From: Diego Rivera Date: Mon, 28 Nov 2022 15:13:48 -0600 Subject: [PATCH 4/4] Rollback changes --- CHANGELOG.md | 4 ---- README.md | 4 ++-- plex.go | 2 +- tvheadenv.go | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 463cbf8..d6381c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,5 @@ # Changelog -## v1.0.2 - 2022-11-28 - -* Fix to support string-formatted channel numbers (from papaschloss) - ## v1.0.1 - 2017-11-29 * Update golang to 1.9.3 [Will Boyce] diff --git a/README.md b/README.md index aa01661..4bba3a9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/wrboyce/plexheadend)](https://goreportcard.com/report/github.com/wrboyce/plexheadend) [![CircleCI](https://circleci.com/gh/wrboyce/plexheadend.png?style=shield)](https://circleci.com/gh/wrboyce/plexheadend) -Proxy requests between PlexDVR and TVHeadend. Now supports non-numeric channel numbers (i.e. "21.1", per changes by papaschloss). +Proxy requests between PlexDVR and TVHeadend ## Installation @@ -86,4 +86,4 @@ services: - 32400:32400 - 32400:32400/udp restart: unless-stopped -``` +``` \ No newline at end of file diff --git a/plex.go b/plex.go index 1b376b2..fbe1d30 100644 --- a/plex.go +++ b/plex.go @@ -76,7 +76,7 @@ func (p *plexHeadend) lineupHandler(w http.ResponseWriter, r *http.Request) { for _, channel := range p.tvhGetChannels() { if p.tag == "" || sliceContains(channel.Tags, p.tag) { data = append(data, - lineupResponse{fmt.Sprintf("%s", channel.Number), channel.Name, channel.URL}) + lineupResponse{fmt.Sprintf("%d", channel.Number), channel.Name, channel.URL}) } } json.NewEncoder(w).Encode(data) diff --git a/tvheadenv.go b/tvheadenv.go index 7042ef1..68c92c4 100644 --- a/tvheadenv.go +++ b/tvheadenv.go @@ -39,7 +39,7 @@ type apiChannelsResponse struct { type apiChannel struct { UUID string `json:"uuid"` Name string `json:"name"` - Number string `json:"number"` + Number int `json:"number"` Tags []string `json:"tags"` URL string `json:"url"` }