fix: 'best' format on audio-only sites (SoundCloud) now shows audio containers
All checks were successful
CI / build (push) Successful in 51s
All checks were successful
CI / build (push) Successful in 51s
- When content is audio-only (IsAudioOnlyContent), 'best' format is marked as IsAudioOnly so determineMediaType returns MediaTypeAudio - Previously 'best' was hardcoded with HasVideo:true, causing video containers (mp4/mkv) to be shown instead of audio containers (mp3/m4a/opus)
This commit is contained in:
@@ -166,7 +166,11 @@ func (h *Handler) handleFormatSelection(ctx context.Context, chatID int64, msgID
|
||||
ss.MainFormatID = formatID
|
||||
|
||||
if formatID == "best" {
|
||||
ss.MainFormat = &domain.Format{ID: "best", HasVideo: true, HasAudio: true}
|
||||
if ss.MediaInfo.IsAudioOnlyContent() {
|
||||
ss.MainFormat = &domain.Format{ID: "best", HasAudio: true, IsAudioOnly: true}
|
||||
} else {
|
||||
ss.MainFormat = &domain.Format{ID: "best", HasVideo: true, HasAudio: true}
|
||||
}
|
||||
h.advanceToLanguage(ctx, chatID, msgID, userID, ss)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user