fix: show bitrate for audio-only formats, filter subtitle languages, improve feedback
All checks were successful
CI / build (push) Successful in 50s

- Prioritize IsAudioOnly check in formatLabelForDisplay so bitrate
  is shown instead of yt-dlp's generic 'audio only' resolution
- Only collect languages from formats with audio/video to prevent
  subtitle-only tracks from triggering the language selection prompt
- Show 'Fetching metadata...' message before GetMediaInfo and edit
  with results, improving UX for URL input
- Add test coverage for audio-only format labels
This commit is contained in:
2026-06-26 12:12:33 +03:30
parent 464f20a46c
commit f5204b9554
3 changed files with 63 additions and 28 deletions

View File

@@ -171,7 +171,9 @@ func (c *Client) GetMediaInfo(url string) (*domain.MediaInfo, error) {
for _, f := range info.Formats {
ff := c.convertFormat(f)
mi.Formats = append(mi.Formats, ff)
if ff.Language != "" && !langSet[ff.Language] {
// Only consider languages from formats with audio or video to avoid
// prompting for subtitle-only or auto-generated caption languages.
if (ff.HasAudio || ff.HasVideo) && ff.Language != "" && !langSet[ff.Language] {
langSet[ff.Language] = true
mi.Languages = append(mi.Languages, ff.Language)
}