Skip to content

Commit 8befae9

Browse files
committed
Use correct author and title for feeds from playlists
1 parent 42f961f commit 8befae9

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

pkg/builder/youtube.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,20 +212,20 @@ func (yt *YouTubeBuilder) queryFeed(ctx context.Context, feed *model.Feed, info
212212
return err
213213
}
214214

215-
feed.Title = fmt.Sprintf("%s: %s", playlist.Snippet.ChannelTitle, playlist.Snippet.Title)
215+
feed.Title = playlist.Snippet.Title
216216
feed.Description = playlist.Snippet.Description
217217

218218
feed.ItemURL = fmt.Sprintf("https://youtube.com/playlist?list=%s", playlist.Id)
219219
feed.ItemID = playlist.Id
220220

221-
feed.Author = "<notfound>"
221+
feed.Author = playlist.Snippet.ChannelTitle
222222

223223
if date, err := yt.parseDate(playlist.Snippet.PublishedAt); err != nil {
224224
return err
225225
} else { // nolint:golint
226226
feed.PubDate = date
227227
}
228-
228+
229229
thumbnails = playlist.Snippet.Thumbnails
230230

231231
default:
@@ -236,8 +236,8 @@ func (yt *YouTubeBuilder) queryFeed(ctx context.Context, feed *model.Feed, info
236236
feed.Description = fmt.Sprintf("%s (%s)", feed.Title, feed.PubDate)
237237
}
238238

239-
feed.CoverArt = yt.selectThumbnail(thumbnails, feed.CoverArtQuality, "")
240-
239+
feed.CoverArt = yt.selectThumbnail(thumbnails, feed.CoverArtQuality, "")
240+
241241
return nil
242242
}
243243

pkg/feed/xml.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@ func Build(_ctx context.Context, feed *model.Feed, cfg *Config, hostname string)
3838

3939
var (
4040
now = time.Now().UTC()
41-
author = feed.Title
41+
author = feed.Author
4242
title = feed.Title
4343
description = feed.Description
4444
feedLink = feed.ItemURL
4545
)
4646

47+
if author == "<notfound>" {
48+
author = feed.Title
49+
}
50+
4751
if cfg.Custom.Author != "" {
4852
author = cfg.Custom.Author
4953
}

services/update/updater.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (u *Manager) updateFeed(ctx context.Context, feedConfig *feed.Config) error
101101
}
102102

103103
// Create an updater for this feed type
104-
provider, err := builder.New(ctx, info.Provider, keyProvider.Get())
104+
provider, err := builder.New(ctx, info.Provider, keyProvider.Get(), u.downloader)
105105
if err != nil {
106106
return err
107107
}

0 commit comments

Comments
 (0)