1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00

Support overwriting title, author and description of feed (#177)

Fixes #176
This commit is contained in:
Paul Götzinger
2020-10-01 22:51:47 +02:00
committed by GitHub
parent a4f8545b02
commit 27e41d7599
2 changed files with 27 additions and 9 deletions

View File

@@ -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 {

View File

@@ -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)