episode_old_age -> auto.cleanup.days

This commit is contained in:
auouymous 2022-12-08 15:25:26 -07:00
parent 84c35c76fd
commit c6695f5b69
4 changed files with 9 additions and 9 deletions

View File

@ -112,11 +112,11 @@ def get_expired_episodes(channels, config):
continue
# Only expire episodes if the age in days is positive
if config.episode_old_age < 1:
if config.auto.cleanup.days < 1:
continue
# Never consider fresh episodes as old
if episode.age_in_days() < config.episode_old_age:
if episode.age_in_days() < config.auto.cleanup.days:
continue
# Do not delete played episodes (except if configured)

View File

@ -228,7 +228,6 @@ defaults = {
# The sooner this goes away, the better
gPodderSettings_LegacySupport = {
'episode_old_age': 'auto.cleanup.days',
'auto_remove_played_episodes': 'auto.cleanup.played',
'auto_remove_unfinished_episodes': 'auto.cleanup.unfinished',
'auto_remove_unplayed_episodes': 'auto.cleanup.unplayed',

View File

@ -265,11 +265,11 @@ class gPodderPreferences(BuilderWidget):
if self._config.auto_remove_played_episodes:
adjustment_expiration = self.hscale_expiration.get_adjustment()
if self._config.episode_old_age > adjustment_expiration.get_upper():
if self._config.auto.cleanup.days > adjustment_expiration.get_upper():
# Patch the adjustment to include the higher current value
adjustment_expiration.set_upper(self._config.episode_old_age)
adjustment_expiration.set_upper(self._config.auto.cleanup.days)
self.hscale_expiration.set_value(self._config.episode_old_age)
self.hscale_expiration.set_value(self._config.auto.cleanup.days)
else:
self.hscale_expiration.set_value(0)
@ -599,7 +599,7 @@ class gPodderPreferences(BuilderWidget):
self._config.auto_remove_unplayed_episodes = False
else:
self._config.auto_remove_played_episodes = True
self._config.episode_old_age = value
self._config.auto.cleanup.days = value
self.checkbutton_expiration_unplayed.set_sensitive(value > 0)
self.checkbutton_expiration_unfinished.set_sensitive(value > 0)

View File

@ -3079,11 +3079,12 @@ class gPodder(BuilderWidget, dbus.service.Object):
('markup_delete_episodes', None, None, _('Episode')),
)
msg_older_than = N_('Select older than %(count)d day', 'Select older than %(count)d days', self.config.episode_old_age)
msg_older_than = N_('Select older than %(count)d day', 'Select older than %(count)d days', self.config.auto.cleanup.days)
selection_buttons = {
_('Select played'): lambda episode: not episode.is_new,
_('Select finished'): lambda episode: episode.is_finished(),
msg_older_than % {'count': self.config.episode_old_age}: lambda episode: episode.age_in_days() > self.config.episode_old_age,
msg_older_than % {'count': self.config.auto.cleanup.days}:
lambda episode: episode.age_in_days() > self.config.auto.cleanup.days,
}
instructions = _('Select the episodes you want to delete:')