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

Override the default link

This will override the default link (usually the URL address) in the generated RSS feed with another link.

fixes #233
This commit is contained in:
Johannes Hoppe
2022-06-24 00:21:28 +02:00
parent 5d8b3ee3fd
commit 44f4f3586c
3 changed files with 9 additions and 1 deletions

View File

@ -95,6 +95,8 @@ vimeo = [ # Multiple keys will be rotated.
author = "Mrs. Smith (mrs@smith.org)" author = "Mrs. Smith (mrs@smith.org)"
ownerName = "Mrs. Smith" ownerName = "Mrs. Smith"
ownerEmail = "mrs@smith.org" ownerEmail = "mrs@smith.org"
# optional: this will override the default link (usually the URL address) in the generated RSS feed with another link
link = "https://example.org"
# Podsync uses local database to store feeds and episodes metadata. # Podsync uses local database to store feeds and episodes metadata.
# This section is optional and usually not needed to configure unless some very specific corner cases. # This section is optional and usually not needed to configure unless some very specific corner cases.

View File

@ -64,6 +64,7 @@ type Custom struct {
Description string `toml:"description"` Description string `toml:"description"`
OwnerName string `toml:"ownerName"` OwnerName string `toml:"ownerName"`
OwnerEmail string `toml:"ownerEmail"` OwnerEmail string `toml:"ownerEmail"`
Link string `toml:"link"`
} }
type Cleanup struct { type Cleanup struct {

View File

@ -41,6 +41,7 @@ func Build(_ctx context.Context, feed *model.Feed, cfg *Config, hostname string)
author = feed.Title author = feed.Title
title = feed.Title title = feed.Title
description = feed.Description description = feed.Description
feedLink = feed.ItemURL
) )
if cfg.Custom.Author != "" { if cfg.Custom.Author != "" {
@ -55,7 +56,11 @@ func Build(_ctx context.Context, feed *model.Feed, cfg *Config, hostname string)
description = cfg.Custom.Description description = cfg.Custom.Description
} }
p := itunes.New(title, feed.ItemURL, description, &feed.PubDate, &now) if cfg.Custom.Link != "" {
feedLink = cfg.Custom.Link
}
p := itunes.New(title, feedLink, description, &feed.PubDate, &now)
p.Generator = podsyncGenerator p.Generator = podsyncGenerator
p.AddSubTitle(title) p.AddSubTitle(title)
p.IAuthor = author p.IAuthor = author