diff --git a/pkg/config/config.go b/pkg/config/config.go index 2c8ccd3..0726f0a 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -55,10 +55,13 @@ type Filters struct { } type Custom struct { - CoverArt string `toml:"cover_art"` - Category string `toml:"category"` - Explicit bool `toml:"explicit"` - Language string `toml:"lang"` + CoverArt string `toml:"cover_art"` + Category string `toml:"category"` + Explicit bool `toml:"explicit"` + Language string `toml:"lang"` + Author string `toml:"author"` + Title string `toml:"title"` + Description string `toml:"description"` } type Server struct { diff --git a/pkg/feed/xml.go b/pkg/feed/xml.go index a6d3a07..7fc6960 100644 --- a/pkg/feed/xml.go +++ b/pkg/feed/xml.go @@ -37,14 +37,29 @@ func Build(ctx context.Context, feed *model.Feed, cfg *config.Feed, provider url ) var ( - now = time.Now().UTC() + now = time.Now().UTC() + author = feed.Title + title = feed.Title + description = feed.Description ) - p := itunes.New(feed.Title, feed.ItemURL, feed.Description, &feed.PubDate, &now) + if cfg.Custom.Author != "" { + author = cfg.Custom.Author + } + + if cfg.Custom.Title != "" { + title = cfg.Custom.Title + } + + if cfg.Custom.Description != "" { + description = cfg.Custom.Description + } + + p := itunes.New(title, feed.ItemURL, description, &feed.PubDate, &now) p.Generator = podsyncGenerator - p.AddSubTitle(feed.Title) - p.IAuthor = feed.Title - p.AddSummary(feed.Description) + p.AddSubTitle(title) + p.IAuthor = author + p.AddSummary(description) if cfg.Custom.CoverArt != "" { p.AddImage(cfg.Custom.CoverArt)