refactor: rename Format to Quality, add container Audio/Video sub-pickers

- Rename 'Format' button to 'Quality' in settings (audio_quality/video_quality)
- Add DefaultAudioContainer and DefaultVideoContainer to UserPreferences
- Container settings now has Audio/Video sub-pickers (mp3/m4a/opus vs mp4/mkv/webm)
- Add migration 003 for new container columns
- Update repo layer and playlist flow for new fields
- Update back routing: back_quality, back_container
This commit is contained in:
2026-06-25 16:03:03 +03:30
parent e08ed77884
commit 785e20bf94
7 changed files with 112 additions and 53 deletions

View File

@@ -66,7 +66,8 @@ func TestPreferences(t *testing.T) {
prefs.DefaultMediaType = domain.MediaTypeAudio
prefs.DefaultAudioFormat = "best"
prefs.DefaultVideoFormat = "1080p"
prefs.DefaultContainer = "mp3"
prefs.DefaultAudioContainer = "mp3"
prefs.DefaultVideoContainer = "mp4"
prefs.DefaultLanguage = "en"
if err := s.UpdatePreferences(userID, prefs); err != nil {
t.Fatalf("UpdatePreferences() failed: %v", err)
@@ -85,8 +86,11 @@ func TestPreferences(t *testing.T) {
if got.DefaultVideoFormat != "1080p" {
t.Errorf("video format = %q, want 1080p", got.DefaultVideoFormat)
}
if got.DefaultContainer != "mp3" {
t.Errorf("container = %q, want mp3", got.DefaultContainer)
if got.DefaultAudioContainer != "mp3" {
t.Errorf("audio container = %q, want mp3", got.DefaultAudioContainer)
}
if got.DefaultVideoContainer != "mp4" {
t.Errorf("video container = %q, want mp4", got.DefaultVideoContainer)
}
if got.DefaultLanguage != "en" {
t.Errorf("language = %q, want en", got.DefaultLanguage)