only purge completed podcast episodes

* Only purge completed podcast episodes.

* Removed Debug() for GORM.

* Update podcasts/podcasts.go

Co-authored-by: Senan Kelly <senan@senan.xyz>

Co-authored-by: Senan Kelly <senan@senan.xyz>
This commit is contained in:
brian-doherty
2022-11-09 11:15:20 -06:00
committed by GitHub
parent b7bf8cb70b
commit bf3c13b568

View File

@@ -520,7 +520,7 @@ func (p *Podcasts) PurgeOldPodcasts(maxAge time.Duration) error {
expDate := time.Now().Add(-maxAge)
var episodes []*db.PodcastEpisode
err := p.db.
Debug().
Where("status = ?", db.PodcastEpisodeStatusCompleted).
Where("created_at < ?", expDate).
Where("updated_at < ?", expDate).
Where("modified_at < ?", expDate).