From cc6c451acb9ea40df862c924ed06958cd357d634 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Mon, 5 Apr 2021 19:38:29 +0200 Subject: [PATCH 1/3] Traduction --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 79f795b..4af987d 100644 --- a/manifest.json +++ b/manifest.json @@ -84,7 +84,7 @@ "optional": true, "ask": { "en": "Do you want to allow uploading of books?", - "fr": "Voulez vous autoriser l'upload de livres?" + "fr": "Voulez vous autoriser le téléversement de livres?" }, "help":{ "en":"You may change it later in the app", From 35f939bc43481414751ce55bb220cc28faa2c8b5 Mon Sep 17 00:00:00 2001 From: Krakinou Date: Mon, 5 Apr 2021 19:39:13 +0200 Subject: [PATCH 2/3] Restore access to multimedia folders --- scripts/restore | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/scripts/restore b/scripts/restore index 1940d75..673c081 100755 --- a/scripts/restore +++ b/scripts/restore @@ -66,6 +66,7 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei # Create the dedicated user (if not existing) ynh_system_user_create --username=$app + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -81,6 +82,7 @@ ynh_restore_file --origin_path="$final_path" chown -R $app: $final_path #================================================= + # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES @@ -127,25 +129,37 @@ chown -R $app:$app /var/log/$app # RESTORE THE DATA DIRECTORY #================================================= -ynh_script_progression --message="Restoring data directory..." --weight=2 +ynh_script_progression --message="Restoring data directory if required..." --weight=2 # The data directory will be restored only if it exists in the backup archive # So only if it was backup previously. - -if [ -d "$YNH_BACKUP_DIR/apps/$app/backup/$calibre_dir" ] -then +#if [ -d "$YNH_BACKUP_DIR/apps/$app/backup/$calibre_dir" ] && [ ! tail "$calibre_dir" | grep "yunohost.multimedia" ]; then ynh_restore_file --origin_path="$calibre_dir" --not_mandatory -else - if [ ! -e "$calibre_dir" ]; then - ynh_print_info "Create calibre library folder $calibre_dir" - mkdir -p $calibre_dir - chown -R $app:$app $calibre_dir - fi -#Check if metadata.db file exists. If not create it (empty library) - if [ ! -e "$calibre_dir"/metadata.db ]; then - cp -a ../settings/conf/metadata.db.empty $calibre_dir/metadata.db - chown $app:$app $calibre_dir/* - fi +#fi + +#================================================= +# RESTORE THE MULTIMEDIA DIR IF NOT EXISTING +#================================================= +ynh_script_progression --message="Restoring the multimedia directory..." --weight=5 +ynh_multimedia_build_main_dir +ynh_multimedia_addaccess $app + +#================================================= +# INITIALIZE DATA IF NOT EXISTING +#================================================= + +if [ ! -e "$calibre_dir" ]; then + ynh_print_info "Create calibre library folder $calibre_dir" + mkdir -p $calibre_dir + chown -R $app:$app $calibre_dir fi +#Check if metadata.db file exists. If not create it (empty library) +if [ ! -e "$calibre_dir"/metadata.db ]; then + cp -a ../settings/conf/metadata.db.empty $calibre_dir/metadata.db + chown $app:$app $calibre_dir/* +fi + + + #Update Imagick policy as per https://github.com/janeczku/calibre-web/wiki/FAQ#what-to-do-if-cover-pictures-are-not-extracted-from-pdf-files ynh_replace_string --match_string="" \ From 7fe8862e809694c2f9a60ff1fc32ed003da1c36d Mon Sep 17 00:00:00 2001 From: Krakinou Date: Mon, 5 Apr 2021 19:45:01 +0200 Subject: [PATCH 3/3] Aesthetic changes --- scripts/restore | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/restore b/scripts/restore index 673c081..f07958c 100755 --- a/scripts/restore +++ b/scripts/restore @@ -66,23 +66,18 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei # Create the dedicated user (if not existing) ynh_system_user_create --username=$app - #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=1 - ynh_restore_file --origin_path="$final_path" #================================================= # RESTORE USER RIGHTS #================================================= - -# Restore permissions on app files chown -R $app: $final_path #================================================= - # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES @@ -158,9 +153,9 @@ if [ ! -e "$calibre_dir"/metadata.db ]; then chown $app:$app $calibre_dir/* fi - - - +#=================================================== +# SPECIFIC SETUP +#=================================================== #Update Imagick policy as per https://github.com/janeczku/calibre-web/wiki/FAQ#what-to-do-if-cover-pictures-are-not-extracted-from-pdf-files ynh_replace_string --match_string="" \ --replace_string="" \