Skip to content

Commit aa01a30

Browse files
committed
Update the TTL for the intro to 48 hours
1 parent b7d1053 commit aa01a30

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎config/config.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type StreamConfig struct {
3636
MetaInt int `toml:"metaint"`
3737
BufferSize int `toml:"buffer_size"`
3838
MaxListeners int `toml:"max_listeners"` // 0 = unlimited
39-
IntroSeenTTL int `toml:"intro_seen_ttl"` // Hours before intro replays for same IP (default 2)
39+
IntroSeenTTL int `toml:"intro_seen_ttl"` // Hours before intro replays for same IP (default 48)
4040
}
4141

4242
type AdminConfig struct {

‎docs/configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ port = 8000
3636
[stream]
3737
metaint = 8192 # ICY metadata interval in bytes
3838
buffer_size = 512 # Ring buffer size in KB (512 ~ 32s of 128kbps audio)
39-
intro_seen_ttl = 2 # Hours before intro replays for the same IP (default 2)
39+
intro_seen_ttl = 48 # Hours before intro replays for the same IP (default 48)
4040

4141
[admin]
4242
password = "" # Bearer token for /status endpoints (empty = open)

‎handler/stream.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type Stream struct {
3333
URL string
3434
IntroFile string // Path to intro MP3 (empty = no intro)
3535
GeoDB *geo.DB // Optional MaxMind geo database (nil = no geo lookup)
36-
IntroSeenTTL time.Duration // How long to suppress intro replays (0 = 2h default)
36+
IntroSeenTTL time.Duration // How long to suppress intro replays (0 = 48h default)
3737
}
3838

3939
func (s *Stream) ServeHTTP(w http.ResponseWriter, r *http.Request) {
@@ -82,11 +82,11 @@ func (s *Stream) ServeHTTP(w http.ResponseWriter, r *http.Request) {
8282
// Play intro only on the initial connection — skip for clients that
8383
// have already heard it (e.g. pause/resume causing a reconnect).
8484
// Tracked per stream so switching stations still plays that station's intro.
85-
// The suppression expires after IntroSeenTTL (default 2 hours).
85+
// The suppression expires after IntroSeenTTL (default 48 hours).
8686
if s.IntroFile != "" {
8787
ttl := s.IntroSeenTTL
8888
if ttl == 0 {
89-
ttl = 2 * time.Hour
89+
ttl = 48 * time.Hour
9090
}
9191
key := s.StationID + ":" + ip
9292
playIntro := true

0 commit comments

Comments
 (0)