Clean up episodes before generating XML feed

This commit is contained in:
Contextualist
2022-07-27 00:35:54 -04:00
parent ef14d27c11
commit e57746dc82
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ func Build(_ctx context.Context, feed *model.Feed, cfg *Config, hostname string)
for i, episode := range feed.Episodes {
if episode.Status != model.EpisodeDownloaded {
// Skip episodes that are not yet downloaded
// Skip episodes that are not yet downloaded or have been removed
continue
}
+4 -4
View File
@@ -71,6 +71,10 @@ func (u *Manager) Update(ctx context.Context, feedConfig *feed.Config) error {
return errors.Wrap(err, "download failed")
}
if err := u.cleanup(ctx, feedConfig); err != nil {
log.WithError(err).Error("cleanup failed")
}
if err := u.buildXML(ctx, feedConfig); err != nil {
return errors.Wrap(err, "xml build failed")
}
@@ -79,10 +83,6 @@ func (u *Manager) Update(ctx context.Context, feedConfig *feed.Config) error {
return errors.Wrap(err, "opml build failed")
}
if err := u.cleanup(ctx, feedConfig); err != nil {
log.WithError(err).Error("cleanup failed")
}
elapsed := time.Since(started)
log.Infof("successfully updated feed in %s", elapsed)
return nil