Allow disable login

This commit is contained in:
Alex Ling
2020-12-28 16:13:51 +00:00
parent b6a204f5bd
commit 85ad38c321
4 changed files with 53 additions and 6 deletions

View File

@@ -20,6 +20,8 @@ class Config
property plugin_path : String = File.expand_path "~/mango/plugins",
home: true
property download_timeout_seconds : Int32 = 30
property disable_login = false
property default_username = ""
property mangadex = Hash(String, String | Int32).new
@[YAML::Field(ignore: true)]
@@ -85,5 +87,9 @@ class Config
unless base_url.ends_with? "/"
@base_url += "/"
end
if disable_login && default_username.empty?
raise "Login is disabled, but default username is not set. " \
"Please set a default username"
end
end
end