Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override the default link #333

Merged
merged 1 commit into from
Jun 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ vimeo = [ # Multiple keys will be rotated.
author = "Mrs. Smith ([email protected])"
ownerName = "Mrs. Smith"
ownerEmail = "[email protected]"
# 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.
# This section is optional and usually not needed to configure unless some very specific corner cases.
Expand Down
1 change: 1 addition & 0 deletions pkg/feed/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type Custom struct {
Description string `toml:"description"`
OwnerName string `toml:"ownerName"`
OwnerEmail string `toml:"ownerEmail"`
Link string `toml:"link"`
}

type Cleanup struct {
Expand Down
7 changes: 6 additions & 1 deletion pkg/feed/xml.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func Build(_ctx context.Context, feed *model.Feed, cfg *Config, hostname string)
author = feed.Title
title = feed.Title
description = feed.Description
feedLink = feed.ItemURL
)

if cfg.Custom.Author != "" {
Expand All @@ -55,7 +56,11 @@ func Build(_ctx context.Context, feed *model.Feed, cfg *Config, hostname string)
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.AddSubTitle(title)
p.IAuthor = author
Expand Down