refactor: settings format picker redesign with Audio/Video sub-pickers, fix delete routing
All checks were successful
CI / build (push) Successful in 48s

- Replace Type/Quality settings with single Format button -> Audio/Video sub-pickers
- Each sub-picker shows format options (bitrates for audio, resolutions for video)
- Replace DefaultQuality with DefaultAudioFormat/DefaultVideoFormat in UserPreferences
- Add DB migration 002 for new preference columns
- Update repo layer SQL queries for new schema
- Update playlist flow to use new preference fields
- Fix missing deleteaccount and delaccount_ callback routing
- Add back_format routing for format picker navigation
This commit is contained in:
2026-06-25 15:55:59 +03:30
parent 30a99ac2fd
commit e08ed77884
7 changed files with 89 additions and 68 deletions

View File

@@ -142,15 +142,20 @@ func (h *Handler) handlePlaylistConfirm(ctx context.Context, chatID int64, msgID
prefs, prefErr := h.Repo.GetOrCreatePreferences(userID)
if prefErr != nil {
prefs = &domain.UserPreferences{
DefaultMediaType: domain.MediaTypeVideoAudio,
DefaultQuality: "best",
DefaultContainer: "mp4",
DefaultMediaType: domain.MediaTypeVideoAudio,
DefaultAudioFormat: "best",
DefaultVideoFormat: "best",
DefaultContainer: "mp4",
}
}
format := &domain.Format{ID: prefs.DefaultQuality}
formatID := prefs.DefaultVideoFormat
if prefs.DefaultMediaType == domain.MediaTypeAudio {
formatID = prefs.DefaultAudioFormat
}
format := &domain.Format{ID: formatID}
for _, f := range info.Formats {
if f.ID == prefs.DefaultQuality {
if f.ID == formatID {
format = &f
break
}