Skip to content

Commit

Permalink
fix empty tvg-name
Browse files Browse the repository at this point in the history
  • Loading branch information
sonroyaalmerol committed Mar 2, 2024
1 parent 6504cc4 commit 42dd952
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions m3u/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ func ParseM3UFromURL(db *sql.DB, m3uURL string, m3uIndex int, maxConcurrency int
case "tvg-logo":
currentStream.LogoURL = value
}

// If tvg-name is empty, use the stream title as a fallback
if key == "tvg-name" && value == "" {
currentStream.Title = strings.TrimSpace(strings.TrimSuffix(strings.TrimPrefix(line, "#EXTINF:-1"), ","))
}
}
} else if strings.HasPrefix(line, "#EXTVLCOPT:") {
// Extract logo URL from #EXTVLCOPT line
Expand Down

0 comments on commit 42dd952

Please sign in to comment.