1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/navidrome_ynh.git synced 2024-09-03 19:46:30 +02:00

Add enable sharing to config panel

This commit is contained in:
Éric Gaspar 2023-01-30 16:56:43 +01:00
parent 4c7411c2b8
commit b0113c9346
4 changed files with 23 additions and 4 deletions

View file

@ -100,3 +100,6 @@ DefaultLanguage="__LANGUAGE__"
# Disable the activity panel that can hang some browsers with >100% CPU usage # Disable the activity panel that can hang some browsers with >100% CPU usage
# See https://github.com/navidrome/navidrome/issues/1511 # See https://github.com/navidrome/navidrome/issues/1511
DevActivityPanel=false DevActivityPanel=false
# Enable the Sharing feature
EnableSharing=__ENABLE_SHARING__

View file

@ -23,6 +23,14 @@ services = ["__APP__"]
help = "Enable the option in the UI to download music/albums/artists/playlists from the server" help = "Enable the option in the UI to download music/albums/artists/playlists from the server"
bind = "EnableDownloads:/var/lib/navidrome/navidrome.toml" bind = "EnableDownloads:/var/lib/navidrome/navidrome.toml"
[main.config.enable_sharing]
ask = "Enable Sharing feature"
type = "boolean"
yes = "true"
no = "false"
help = "Enable the Sharing feature"
bind = "EnableSharing:/var/lib/navidrome/navidrome.toml"
[main.config.scanner_extractor] [main.config.scanner_extractor]
ask = "Select metadata extractor" ask = "Select metadata extractor"
type = "select" type = "select"

View file

@ -35,6 +35,7 @@ enable_downloads="true"
enable_animation="true" enable_animation="true"
enable_transcoding="false" enable_transcoding="false"
welcome_message="" welcome_message=""
enable_sharing="false"
#================================================= #=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
@ -60,6 +61,7 @@ ynh_app_setting_set --app=$app --key=scanner_extractor --value=$scanner_extracto
ynh_app_setting_set --app=$app --key=enable_animation --value=$enable_animation ynh_app_setting_set --app=$app --key=enable_animation --value=$enable_animation
ynh_app_setting_set --app=$app --key=enable_transcoding --value=$enable_transcoding ynh_app_setting_set --app=$app --key=enable_transcoding --value=$enable_transcoding
ynh_app_setting_set --app=$app --key=welcome_message --value=$welcome_message ynh_app_setting_set --app=$app --key=welcome_message --value=$welcome_message
ynh_app_setting_set --app=$app --key=enable_sharing --value=$enable_sharing
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS

View file

@ -27,6 +27,7 @@ scanner_extractor=$(ynh_app_setting_get --app=$app --key=scanner_extractor)
enable_animation=$(ynh_app_setting_get --app=$app --key=enable_animation) enable_animation=$(ynh_app_setting_get --app=$app --key=enable_animation)
enable_transcoding=$(ynh_app_setting_get --app=$app --key=enable_transcoding) enable_transcoding=$(ynh_app_setting_get --app=$app --key=enable_transcoding)
welcome_message=$(ynh_app_setting_get --app=$app --key=welcome_message) welcome_message=$(ynh_app_setting_get --app=$app --key=welcome_message)
enable_sharing=$(ynh_app_setting_get --app=$app --key=enable_sharing)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -100,6 +101,11 @@ if [ -z "$welcome_message" ]; then
ynh_app_setting_set --app=$app --key=welcome_message --value=$welcome_message ynh_app_setting_set --app=$app --key=welcome_message --value=$welcome_message
fi fi
if [ -z "$enable_sharing" ]; then
enable_sharing="false"
ynh_app_setting_set --app=$app --key=enable_sharing --value=$enable_sharing
fi
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
#================================================= #=================================================
@ -149,11 +155,11 @@ ynh_add_nginx_config
config_path="/var/lib/$app" config_path="/var/lib/$app"
# # Uncomment when there is new options added upstream # Uncomment when there is new options added upstream
# ynh_add_config --template="../conf/navidrome.toml" --destination="$config_path/navidrome.toml" ynh_add_config --template="../conf/navidrome.toml" --destination="$config_path/navidrome.toml"
# chmod 600 "$config_path/navidrome.toml" chmod 600 "$config_path/navidrome.toml"
# chown -R $app:$app "$config_path" chown -R $app:$app "$config_path"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD