diff --git a/src/config/config.go b/src/config/config.go index 7a418c3..8d407f6 100644 --- a/src/config/config.go +++ b/src/config/config.go @@ -100,7 +100,7 @@ type DownloadConfig struct { } type Filters struct { - Extensions []string `env:"EXTENSIONS" env-default:"flac,mp3"` + Extensions []string `env:"EXTENSIONS" env-default:"flac,mp3"` // slskd MinBitDepth int `env:"MIN_BIT_DEPTH" env-default:"8"` MinBitRate int `env:"MIN_BITRATE" env-default:"256"` FilterList []string `env:"FILTER_LIST" env-default:"live,remix,instrumental,extended,clean,acapella"` @@ -110,7 +110,7 @@ type Youtube struct { APIKey string `env:"YOUTUBE_API_KEY"` FfmpegPath string `env:"FFMPEG_PATH"` YtdlpPath string `env:"YTDLP_PATH"` - FileExtension string `env:"TRACK_EXTENSION" env-default:"opus"` + FileExtension string `env:"TRACK_EXTENSION" env-default:"opus"` // yt-dlp CookiesPath string `env:"COOKIES_PATH" env-default:"./cookies.txt"` Filters Filters } diff --git a/src/web/backend/server.go b/src/web/backend/server.go index 234a02b..4afc853 100644 --- a/src/web/backend/server.go +++ b/src/web/backend/server.go @@ -584,10 +584,11 @@ func (s *Server) handleWizardStep3(w http.ResponseWriter, r *http.Request) { MigrateDownloads bool `json:"migrate_downloads"` DownloadServices []string `json:"download_services"` YoutubeAPIKey string `json:"youtube_api_key"` - TrackExtension string `json:"track_extension"` + TrackExtension string `json:"track_extension"` // yt-dlp FilterList string `json:"filter_list"` SlskdURL string `json:"slskd_url"` SlskdAPIKey string `json:"slskd_api_key"` + Extensions string `json:"extensions"` // slskd } if err := json.NewDecoder(r.Body).Decode(&body); err != nil { http.Error(w, "invalid JSON: "+err.Error(), http.StatusBadRequest) @@ -613,10 +614,11 @@ func (s *Server) handleWizardStep3(w http.ResponseWriter, r *http.Request) { "MIGRATE_DOWNLOADS": migrateDL, "DOWNLOAD_SERVICES": joined, "YOUTUBE_API_KEY": body.YoutubeAPIKey, - "TRACK_EXTENSION": body.TrackExtension, + "TRACK_EXTENSION": body.TrackExtension, // yt-dlp "FILTER_LIST": body.FilterList, "SLSKD_URL": body.SlskdURL, "SLSKD_API_KEY": body.SlskdAPIKey, + "EXTENSIONS": body.Extensions, // slskd "WIZARD_COMPLETE": "true", } diff --git a/src/web/frontend/src/components/Wizard.jsx b/src/web/frontend/src/components/Wizard.jsx index 28f4997..e45f00d 100644 --- a/src/web/frontend/src/components/Wizard.jsx +++ b/src/web/frontend/src/components/Wizard.jsx @@ -256,7 +256,7 @@ function Collapse({ open, children }) { function Step3({ fields, setField, envSources, onBack, onFinish, saving }) { const { downloadDir, useSubdirectory, migrateDownloads, dlServices, - youtubeApiKey, trackExtension, filterList, slskdUrl, slskdApiKey } = fields + youtubeApiKey, trackExtension, filterList, slskdUrl, slskdApiKey, extensions } = fields const isLocked = key => envSources[key] === 'env' const valid = () => { @@ -334,6 +334,16 @@ function Step3({ fields, setField, envSources, onBack, onFinish, saving }) { setField('slskdApiKey', e.target.value)} autoComplete="off" spellCheck={false} disabled={isLocked('SLSKD_API_KEY')} /> + + setField('extensions', e.target.value)} + placeholder="flac,mp3" autoComplete="off" spellCheck={false} disabled={isLocked('EXTENSIONS')} /> + + + setField('filterList', e.target.value)} + placeholder="live,remix,instrumental,extended,clean,acapella" autoComplete="off" spellCheck={false} disabled={isLocked('FILTER_LIST')} /> +

By default, slskd saves tracks to whichever download path is configured in your slskd instance. @@ -414,6 +424,7 @@ export default function Wizard({ config, envSources, bgUrl, bgLoaded, onBgLoad, filterList: config.FILTER_LIST || '', slskdUrl: config.SLSKD_URL || '', slskdApiKey: config.SLSKD_API_KEY || '', + extensions: config.EXTENSIONS || '', } }) @@ -465,6 +476,7 @@ export default function Wizard({ config, envSources, bgUrl, bgLoaded, onBgLoad, migrate_downloads: fields.migrateDownloads, download_services: services, youtube_api_key: fields.youtubeApiKey, track_extension: fields.trackExtension, filter_list: fields.filterList, slskd_url: fields.slskdUrl, slskd_api_key: fields.slskdApiKey, + extensions: fields.extensions, }) onComplete() } catch (e) {