Skip to content

Commit c2cc012

Browse files
committed
add common fixes to config
1 parent fa80b44 commit c2cc012

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/config/config.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,16 @@ func (cfg *Config) ReadEnv() {
175175
}
176176
}
177177

178-
cfg.VerifyDir()
178+
cfg.CommonFixes()
179179
}
180180

181-
func (cfg *Config) VerifyDir() {
181+
func (cfg *Config) CommonFixes() {
182+
cfg.DownloadCfg.Youtube.FileExtension = strings.TrimPrefix(cfg.DownloadCfg.Youtube.FileExtension, ".")
183+
cfg.ClientCfg.URL = strings.TrimSuffix(cfg.ClientCfg.URL, "/")
184+
cfg.NormalizeDir()
185+
}
186+
187+
func (cfg *Config) NormalizeDir() {
182188
if cfg.System == "mpd" {
183189
cfg.ClientCfg.PlaylistDir = fixDir(cfg.ClientCfg.PlaylistDir)
184190
}

0 commit comments

Comments
 (0)