Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,11 @@ func getTuner(id, playlistType string) (tuner int) {
playListInterface = Settings.Files.HDHR[id]
}
if playListMap, ok := playListInterface.(map[string]interface{}); ok {
playListBuffer = playListMap["buffer"].(string)
if buffer, ok := playListMap["buffer"].(string); ok {
playListBuffer = buffer
} else {
playListBuffer = "-"
}
}
systemMutex.Unlock()

Expand Down
3 changes: 2 additions & 1 deletion src/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ func getProviderData(fileType, fileID string) (err error) {
for _, channel := range newM3u {
channelMap := channel.(map[string]string)

extinf := fmt.Sprintf(`#EXTINF:-1 tvg-id="%s" tvg-name="%s" tvg-logo="%s" group-title="%s",%s`,
extinf := fmt.Sprintf(`#EXTINF:-1 tvg-id="%s" tvg-name="%s" tvg-chno="%s" tvg-logo="%s" group-title="%s",%s`,
channelMap["tvg-id"],
channelMap["tvg-name"],
channelMap["tvg-chno"],
channelMap["tvg-logo"],
channelMap["group-title"],
channelMap["name"],
Expand Down
64 changes: 32 additions & 32 deletions src/webUI.go

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions src/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,30 @@ func Stream(w http.ResponseWriter, r *http.Request) {
}
}

if r.Method == "HEAD" {
client := &http.Client{}
req, err := http.NewRequest("HEAD", streamInfo.URL, nil)
if err != nil {
ShowError(err, 1501)
httpStatusError(w, r, 405)
return
}
resp, err := client.Do(req)
if err != nil {
ShowError(err, 1502)
httpStatusError(w, r, 405)
return
}
defer resp.Body.Close()
// Copy headers from the source HEAD response to the outgoing response
for key, values := range resp.Header {
for _, value := range values {
w.Header().Add(key, value)
}
}
return
}

var playListBuffer string
systemMutex.Lock()
playListInterface := Settings.Files.M3U[streamInfo.PlaylistID]
Expand Down Expand Up @@ -182,6 +206,8 @@ func Stream(w http.ResponseWriter, r *http.Request) {
showInfo("Streaming URL:" + streamInfo.URL)
w.Header().Set("Access-Control-Allow-Origin", "*")
http.Redirect(w, r, streamInfo.URL, 302)
showInfo("Streaming Info:URL was passed to the client.")
showInfo("Streaming Info:Threadfin is no longer involved, the client connects directly to the streaming server.")
default:
bufferingStream(streamInfo.PlaylistID, streamInfo.URL, streamInfo.BackupChannel1, streamInfo.BackupChannel2, streamInfo.BackupChannel3, streamInfo.Name, w, r)
}
Expand Down Expand Up @@ -1193,6 +1219,7 @@ func getContentType(filename string) (contentType string) {
".gif": "image/gif",
".svg": "image/svg+xml",
".ico": "image/x-icon",
".webp": "image/webp",
".mp4": "video/mp4",
".webm": "video/webm",
".ogg": "video/ogg",
Expand Down
2 changes: 1 addition & 1 deletion src/xepg.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func buildXEPG(background bool) {

}

// XEPG Daten aktualisieren
// Update XEPG data
func updateXEPG(background bool) {

if System.ScanInProgress == 1 {
Expand Down
4 changes: 2 additions & 2 deletions threadfin.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ var GitHub = GitHubStruct{Branch: "Main", User: "Threadfin", Repo: "Threadfin",
const Name = "Threadfin"

// Version : Version, die Build Nummer wird in der main func geparst.
const Version = "1.2.26"
const Version = "1.2.27"

// DBVersion : Datanbank Version
const DBVersion = "0.5.0"

// APIVersion : API Version
const APIVersion = "1.2.26"
const APIVersion = "1.2.27"

var homeDirectory = fmt.Sprintf("%s%s.%s%s", src.GetUserHomeDirectory(), string(os.PathSeparator), strings.ToLower(Name), string(os.PathSeparator))
var samplePath = fmt.Sprintf("%spath%sto%sthreadfin%s", string(os.PathSeparator), string(os.PathSeparator), string(os.PathSeparator), string(os.PathSeparator))
Expand Down