From 663507805a7d85446ff5702c706c507beecf1ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 29 Mar 2024 13:36:54 +0100 Subject: [PATCH] Fix frequencies settings during upgrade --- scripts/_common.sh | 10 ++++++++++ scripts/upgrade | 1 + 2 files changed, 11 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 45a94fd..9f755fa 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -38,6 +38,16 @@ _set_frequencies() { ynh_app_setting_set --app="$app" --key=frequency_human --value="$frequency_human" } +_fix_frequencies() { + case "$frequency" in + Daily) frequency="daily" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;; + "Each 3 days") frequency="days_3" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;; + "Weekly") frequency="weekly" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;; + "Biweekly") frequency="weeks_2" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;; + "Monthly") frequency="monthly" ; ynh_app_setting_set --app="$app" --key="frequency" --value="$frequency" ;; + esac +} + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a9aec5a..72c4c39 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,6 +12,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Ensuring downward compatibility..." +_fix_frequencies _set_frequencies # If encrypt doesn't exist, create it