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:
@@ -55,10 +55,13 @@ type Filters struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Custom struct {
|
type Custom struct {
|
||||||
CoverArt string `toml:"cover_art"`
|
CoverArt string `toml:"cover_art"`
|
||||||
Category string `toml:"category"`
|
Category string `toml:"category"`
|
||||||
Explicit bool `toml:"explicit"`
|
Explicit bool `toml:"explicit"`
|
||||||
Language string `toml:"lang"`
|
Language string `toml:"lang"`
|
||||||
|
Author string `toml:"author"`
|
||||||
|
Title string `toml:"title"`
|
||||||
|
Description string `toml:"description"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Server struct {
|
type Server struct {
|
||||||
|
@@ -37,14 +37,29 @@ func Build(ctx context.Context, feed *model.Feed, cfg *config.Feed, provider url
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
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.Generator = podsyncGenerator
|
||||||
p.AddSubTitle(feed.Title)
|
p.AddSubTitle(title)
|
||||||
p.IAuthor = feed.Title
|
p.IAuthor = author
|
||||||
p.AddSummary(feed.Description)
|
p.AddSummary(description)
|
||||||
|
|
||||||
if cfg.Custom.CoverArt != "" {
|
if cfg.Custom.CoverArt != "" {
|
||||||
p.AddImage(cfg.Custom.CoverArt)
|
p.AddImage(cfg.Custom.CoverArt)
|
||||||
|
Reference in New Issue
Block a user