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

More config panel (#73)

* Fix

* Update config_panel.toml
This commit is contained in:
Éric Gaspar 2022-01-25 10:51:35 +01:00 committed by GitHub
parent 752b04f586
commit 9138d0185b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 1 deletions

View file

@ -16,6 +16,9 @@ BaseURL = "__PATH_URL__"
# Configure periodic scans using “cron” syntax. To disable it altogether, set it to "" (empty string) # Configure periodic scans using “cron” syntax. To disable it altogether, set it to "" (empty string)
ScanSchedule = "@every 1m30s" ScanSchedule = "@every 1m30s"
# Enables transcoding configuration in the UI
EnableTranscodingConfig = "__ENABLE_TRANSCODING__"
# Size of transcoding cache. Set to 0 to disable cache # Size of transcoding cache. Set to 0 to disable cache
TranscodingCacheSize = "150MB" TranscodingCacheSize = "150MB"
@ -35,7 +38,7 @@ EnableDownloads = "__ENABLE_DOWNLOADS__"
UILoginBackgroundUrl = "" UILoginBackgroundUrl = ""
# Add a welcome message to the login screen # Add a welcome message to the login screen
UIWelcomeMessage = "" UIWelcomeMessage = "__WELCOME_MESSAGE__"
# Controls whether the player in the UI will animate the album cover (rotation) # Controls whether the player in the UI will animate the album cover (rotation)
EnableCoverAnimation = "__ENABLE_ANIMATION__" EnableCoverAnimation = "__ENABLE_ANIMATION__"

View file

@ -30,3 +30,17 @@ services = ["__APP__"]
default = "taglib" default = "taglib"
help = "Select metadata extractor implementation" help = "Select metadata extractor implementation"
bind = "Scanner.Extractor:/var/lib/navidrome/navidrome.toml" bind = "Scanner.Extractor:/var/lib/navidrome/navidrome.toml"
[main.config.enable_transcoding]
ask = "Enable transcoding"
type = "boolean"
yes = "true"
no = "false"
help = "Enables transcoding configuration in the UI"
bind = "EnableTranscodingConfig:/var/lib/navidrome/navidrome.toml"
[main.config.welcome_message]
ask = "Welcome message"
type = "string"
help = "Add a welcome message to the login screen"
bind = "UIWelcomeMessage:/var/lib/navidrome/navidrome.toml"

View file

@ -30,6 +30,8 @@ app=$YNH_APP_INSTANCE_NAME
scanner_extractor="taglib" scanner_extractor="taglib"
enable_downloads="true" enable_downloads="true"
enable_animation="true" enable_animation="true"
enable_transcoding="false"
welcome_message=""
#================================================= #=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
@ -52,6 +54,8 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=enable_downloads --value=$enable_downloads ynh_app_setting_set --app=$app --key=enable_downloads --value=$enable_downloads
ynh_app_setting_set --app=$app --key=scanner_extractor --value=$scanner_extractor ynh_app_setting_set --app=$app --key=scanner_extractor --value=$scanner_extractor
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=welcome_message --value=$welcome_message
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS

View file

@ -25,6 +25,8 @@ architecture=$YNH_ARCH
enable_downloads=$(ynh_app_setting_get --app=$app --key=enable_downloads) enable_downloads=$(ynh_app_setting_get --app=$app --key=enable_downloads)
scanner_extractor=$(ynh_app_setting_get --app=$app --key=scanner_extractor) 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)
welcome_message=$(ynh_app_setting_get --app=$app --key=welcome_message)
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
@ -75,6 +77,16 @@ if [ -z "$scanner_extractor" ]; then
ynh_app_setting_set --app=$app --key=scanner_extractor --value=$scanner_extractor ynh_app_setting_set --app=$app --key=scanner_extractor --value=$scanner_extractor
fi fi
if [ -z "$enable_transcoding" ]; then
enable_transcoding="false"
ynh_app_setting_set --app=$app --key=enable_transcoding --value=$enable_transcoding
fi
if [ -z "$welcome_message" ]; then
welcome_message=""
ynh_app_setting_set --app=$app --key=welcome_message --value=$welcome_message
fi
# Cleaning legacy permissions # Cleaning legacy permissions
if ynh_legacy_permissions_exists; then if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all ynh_legacy_permissions_delete_all