From c78ce3ff4e7d5d1dfc79baaae646b9d2e3a55fee Mon Sep 17 00:00:00 2001 From: siddharth Date: Sun, 28 Nov 2021 23:34:15 -0500 Subject: feed: fix Validate Don't set YDLPath and DumpDir on Feed in `Validate` function. Set it in the FeedConfig's `validate` function instead. --- config/config.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/config.go b/config/config.go index 3d8c6f1..360d9a6 100644 --- a/config/config.go +++ b/config/config.go @@ -86,11 +86,13 @@ func (config *FernConfig) validate() error { if len(config.Feeds) == 0 { return fmt.Errorf("'feeds' not set in config") } - for _, feed := range config.Feeds { - err = feed.Validate(config.YDLPath, config.DumpDir) + for i, feed := range config.Feeds { + err = feed.Validate(config.DumpDir) if err != nil { return err } + config.Feeds[i].YDLPath = config.YDLPath + config.Feeds[i].DumpDir = feed.DumpDir } return nil -- cgit v1.2.3