From bf3c13b56843dadac0e7527901d9ab388cd96307 Mon Sep 17 00:00:00 2001 From: brian-doherty <76168809+brian-doherty@users.noreply.github.com> Date: Wed, 9 Nov 2022 11:15:20 -0600 Subject: [PATCH] only purge completed podcast episodes * Only purge completed podcast episodes. * Removed Debug() for GORM. * Update podcasts/podcasts.go Co-authored-by: Senan Kelly Co-authored-by: Senan Kelly --- podcasts/podcasts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/podcasts/podcasts.go b/podcasts/podcasts.go index e326edf..7c69f0a 100644 --- a/podcasts/podcasts.go +++ b/podcasts/podcasts.go @@ -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).