Fix Drone YAML, add regex filters and per-playlist buffer mode (backend)
continuous-integration/drone/push Build is passing

- .drone.yml: two command strings contained ": " and were parsed as maps
  by Drone's YAML loader ("cannot unmarshal !!map into string"). Quoted.
- Filters: new type "regex-filter". The rule is a Go regular expression
  tried against the channel name, the group title and the raw attribute
  line; case-insensitive unless the filter is marked case sensitive.
  Patterns are validated when the filter is saved and when rules are
  rebuilt, and compiled once (cached). The two fixed {include}/!{exclude}
  patterns are compiled at package level instead of per stream.
- Per-playlist buffer: a playlist's "buffer" parameter ("-", "xteve",
  "ffmpeg", "vlc") overrides the global setting for that playlist in
  the stream handler, the buffer start, the tuner lookup and the external
  process buffer. Anything else falls back to the global setting.
  (UI controls for both follow with the Phase 5 frontend work.)
- Tests: TestRegexFilter, TestBufferModeFor.
This commit is contained in:
2026-09-26 13:24:11 +10:00
parent 3a3ba861dc
commit 0b7a54d7da
7 changed files with 190 additions and 17 deletions
+26
View File
@@ -0,0 +1,26 @@
package src
// bufferModeFor : buffer used for a playlist. A playlist can override the
// global "buffer" setting with its own "buffer" parameter ("-", "xteve",
// "ffmpeg" or "vlc"); anything else means "use the global setting".
func bufferModeFor(playlistID string) string {
if len(playlistID) > 0 {
var playlistType string
switch playlistID[0:1] {
case "M":
playlistType = "m3u"
case "H":
playlistType = "hdhr"
}
switch v := getProviderParameter(playlistID, playlistType, "buffer"); v {
case "-", "xteve", "ffmpeg", "vlc":
return v
}
}
return Settings.Buffer
}