Skip to content

Commit

Permalink
Add get_simple_data_table
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Emmanuel Jacquier <15922119+pierre-emmanuelJ@users.noreply.github.com>
  • Loading branch information
pierre-emmanuelJ committed Nov 15, 2019
1 parent 950ae40 commit cd22d4b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/routes/xtream.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"net/url"
"path/filepath"
"strconv"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -199,6 +200,20 @@ func (p *proxy) xtreamPlayerAPI(c *gin.Context, q url.Values) {
}
respBody, err = client.GetSeriesInfo(q["series_id"][0])
case xtreamapi.GetShortEPG:
if len(q["stream_id"]) < 1 {
c.AbortWithError(http.StatusBadRequest, fmt.Errorf(`bad body url query parameters: missing "stream_id"`))
return
}
limit := 0
if len(q["limit"][0]) > 0 {
limit, err = strconv.Atoi(q["limit"][0])
if err != nil {
c.AbortWithError(http.StatusInternalServerError, err)
return
}
}
respBody, err = client.GetShortEPG(q["stream_id"][0], limit)
case xtreamapi.GetSimpleDataTable:
if len(q["stream_id"]) < 1 {
c.AbortWithError(http.StatusBadRequest, fmt.Errorf(`bad body url query parameters: missing "stream_id"`))
return
Expand Down
1 change: 1 addition & 0 deletions pkg/xtream-proxy/xtream-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const (
GetSeries = "get_series"
GetSerieInfo = "get_series_info"
GetShortEPG = "get_short_epg"
GetSimpleDataTable = "get_simple_data_table"
)

type Client struct {
Expand Down

0 comments on commit cd22d4b

Please sign in to comment.