diff --git a/manifest.json b/manifest.json index 9ad34b1..d2972a1 100644 --- a/manifest.json +++ b/manifest.json @@ -12,7 +12,7 @@ "url": "https://www.transmissionbt.com/", "license": " GPL-3.0", "maintainer": { - "name": "Groupe Apps", + "name": "Apps Group", "email": "apps_group@yunohost.org" }, "multi_instance": false, diff --git a/scripts/_common.sh b/scripts/_common.sh index 568300f..79cee95 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,5 +1,19 @@ #!/bin/bash +#================================================= +# YUNOHOST MULTIMEDIA INTEGRATION +#================================================= + +ynh_multimedia_build_main_dir () { + wget -qq https://github.com/YunoHost-Apps/yunohost.multimedia/archive/master.zip + unzip -qq master.zip + sudo ./yunohost.multimedia-master/script/ynh_media_build.sh +} + +ynh_multimedia_addfolder () { + sudo ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="$1" --dest="$2" +} + #================================================= #================================================= # TESTING diff --git a/scripts/install b/scripts/install index aee1c10..5e6faa6 100644 --- a/scripts/install +++ b/scripts/install @@ -65,6 +65,7 @@ ynh_package_install transmission-daemon #================================================= # Add a "/" at the end of path_url for next commands +# To avoid a double / in the nginx config file. [ "$path_url" = "/" ] || path_url=${path_url}/ ynh_nginx_config @@ -112,15 +113,13 @@ ynh_store_file_checksum /etc/transmission-daemon/settings.json # YUNOHOST MULTIMEDIA INTEGRATION #================================================= -wget -qq https://github.com/YunoHost-Apps/yunohost.multimedia/archive/master.zip -unzip -qq master.zip -sudo ./yunohost.multimedia-master/script/ynh_media_build.sh +ynh_multimedia_build_main_dir # Set rights on transmission directory (parent need to be readable by other, and progress need to be writable by multimedia. Because files will move) -sudo ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="/home/yunohost.transmission" --dest="share/Torrents" +ynh_multimedia_addfolder "/home/yunohost.transmission" "share/Torrents" # And share completed directory -sudo ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="/home/yunohost.transmission/completed" --dest="share/Torrents" +ynh_multimedia_addfolder "/home/yunohost.transmission/completed" "share/Torrents" # Share also watched directory, to allow to use it easily -sudo ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="/home/yunohost.transmission/watched" --dest="share/Torrent to download" +ynh_multimedia_addfolder "/home/yunohost.transmission/watched" "share/Torrent to download" #================================================= # PATCH SOURCE TO ADD A DOWNLOAD BUTTON diff --git a/scripts/restore b/scripts/restore index 56240c1..66acbdf 100644 --- a/scripts/restore +++ b/scripts/restore @@ -98,15 +98,13 @@ ynh_app_setting_delete $app backup_core_only # Retire l'option backup_core_only # YUNOHOST MULTIMEDIA INTEGRATION #================================================= -wget -qq https://github.com/YunoHost-Apps/yunohost.multimedia/archive/master.zip -unzip -qq master.zip -sudo ./yunohost.multimedia-master/script/ynh_media_build.sh +ynh_multimedia_build_main_dir # Set rights on transmission directory (parent need to be readable by other, and progress need to be writable by multimedia. Because files will move) -sudo ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="/home/yunohost.transmission" --dest="share/Torrents" +ynh_multimedia_addfolder "/home/yunohost.transmission" "share/Torrents" # And share completed directory -sudo ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="/home/yunohost.transmission/completed" --dest="share/Torrents" +ynh_multimedia_addfolder "/home/yunohost.transmission/completed" "share/Torrents" # Share also watched directory, to allow to use it easily -sudo ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="/home/yunohost.transmission/watched" --dest="share/Torrent to download" +ynh_multimedia_addfolder "/home/yunohost.transmission/watched" "share/Torrent to download" #================================================= # ENABLE SERVICE IN ADMIN PANEL diff --git a/scripts/upgrade b/scripts/upgrade index fca831d..4f6bd16 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,6 +57,7 @@ path_url=$(ynh_normalize_url_path $path_url) # VĂ©rifie et corrige la syntaxe du #================================================= # Add a "/" at the end of path_url for next commands +# To avoid a double / in the nginx config file. [ "$path_url" = "/" ] || path_url=${path_url}/ ynh_nginx_config @@ -107,15 +108,13 @@ ynh_store_file_checksum /etc/transmission-daemon/settings.json # YUNOHOST MULTIMEDIA INTEGRATION #================================================= -wget -qq https://github.com/YunoHost-Apps/yunohost.multimedia/archive/master.zip -unzip -qq master.zip -sudo ./yunohost.multimedia-master/script/ynh_media_build.sh +ynh_multimedia_build_main_dir # Set rights on transmission directory (parent need to be readable by other, and progress need to be writable by multimedia. Because files will move) -sudo ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="/home/yunohost.transmission" --dest="share/Torrents" +ynh_multimedia_addfolder "/home/yunohost.transmission" "share/Torrents" # And share completed directory -sudo ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="/home/yunohost.transmission/completed" --dest="share/Torrents" +ynh_multimedia_addfolder "/home/yunohost.transmission/completed" "share/Torrents" # Share also watched directory, to allow to use it easily -sudo ./yunohost.multimedia-master/script/ynh_media_addfolder.sh --source="/home/yunohost.transmission/watched" --dest="share/Torrent to download" +ynh_multimedia_addfolder "/home/yunohost.transmission/watched" "share/Torrent to download" #================================================= # PATCH SOURCE TO ADD A DOWNLOAD BUTTON