auto_update_frequency -> auto.update.frequency

This commit is contained in:
auouymous 2022-12-08 15:46:11 -07:00
parent 599682f4f2
commit f19632c426
3 changed files with 8 additions and 9 deletions

View File

@ -237,7 +237,6 @@ gPodderSettings_LegacySupport = {
'episode_list_columns': 'ui.gtk.episode_list.columns',
'auto_cleanup_downloads': 'ui.gtk.download_list.remove_finished',
'auto_update_feeds': 'auto.update.enabled',
'auto_update_frequency': 'auto.update.frequency',
}
logger = logging.getLogger(__name__)

View File

@ -239,16 +239,16 @@ class gPodderPreferences(BuilderWidget):
self.update_interval_presets = [0, 10, 30, 60, 2 * 60, 6 * 60, 12 * 60]
adjustment_update_interval = self.hscale_update_interval.get_adjustment()
adjustment_update_interval.set_upper(len(self.update_interval_presets) - 1)
if self._config.auto_update_frequency in self.update_interval_presets:
index = self.update_interval_presets.index(self._config.auto_update_frequency)
if self._config.auto.update.frequency in self.update_interval_presets:
index = self.update_interval_presets.index(self._config.auto.update.frequency)
self.hscale_update_interval.set_value(index)
else:
# Patch in the current "custom" value into the mix
self.update_interval_presets.append(self._config.auto_update_frequency)
self.update_interval_presets.append(self._config.auto.update.frequency)
self.update_interval_presets.sort()
adjustment_update_interval.set_upper(len(self.update_interval_presets) - 1)
index = self.update_interval_presets.index(self._config.auto_update_frequency)
index = self.update_interval_presets.index(self._config.auto.update.frequency)
self.hscale_update_interval.set_value(index)
self._config.connect_gtk_spinbutton('limit.episodes', self.spinbutton_episode_limit)
@ -576,7 +576,7 @@ class gPodderPreferences(BuilderWidget):
def on_update_interval_value_changed(self, range):
value = int(range.get_value())
self._config.auto_update_feeds = (value > 0)
self._config.auto_update_frequency = self.update_interval_presets[value]
self._config.auto.update.frequency = self.update_interval_presets[value]
def on_combo_auto_download_changed(self, widget):
index = self.combo_auto_download.get_active()

View File

@ -3773,10 +3773,10 @@ class gPodder(BuilderWidget, dbus.service.Object):
self._auto_update_timer_source_id = None
if (self.config.auto_update_feeds
and self.config.auto_update_frequency):
interval = 60 * 1000 * self.config.auto_update_frequency
and self.config.auto.update.frequency):
interval = 60 * 1000 * self.config.auto.update.frequency
logger.debug('Setting up auto update timer with interval %d.',
self.config.auto_update_frequency)
self.config.auto.update.frequency)
self._auto_update_timer_source_id = GLib.timeout_add(
interval, self._on_auto_update_timer)