mirror of
https://github.com/mxpv/podsync.git
synced 2024-05-11 05:55:04 +00:00
Merge pull request #368 from Contextualist/fix-cleanup
Clean up episodes before generating XML feed
This commit is contained in:
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user