add warning on track page if only a snippet is available

This commit is contained in:
Laptop
2024-12-21 22:22:22 +02:00
parent 616db41ead
commit e3a4f7f861
2 changed files with 9 additions and 1 deletions

View File

@@ -48,7 +48,9 @@ type Track struct {
type TrackPolicy string
const (
PolicyBlock TrackPolicy = "BLOCK"
PolicyBlock TrackPolicy = "BLOCK" // not available (in your country)
PolicySnip TrackPolicy = "SNIP" // 30-second snippet available
PolicyAllow TrackPolicy = "ALLOW" // all good
)
type Protocol string

View File

@@ -81,6 +81,12 @@ templ TrackPlayer(prefs cfg.Preferences, track sc.Track, stream string, displayE
}
</noscript>
}
if track.Policy == sc.PolicySnip {
<div>
<p>Only a 30-second snippet is available.</p>
</div>
}
if *prefs.ShowAudio {
<div>
if audioPref == cfg.AudioBest {