diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-05-20 18:53:38 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-05-20 18:53:38 +0530 |
commit | c27319552d138bf6f853c8d9cc7eb2af24c27136 (patch) | |
tree | 196bce9ebdf8f008b9fe2343b9c13d47eb9c4543 | |
parent | 775b8a4a1c8b73a38ecc7e75495361a6e9d74be1 (diff) |
made 'nsfw' in config file global
-rw-r--r-- | macli.toml | 11 | ||||
-rw-r--r-- | util/bind_config.go | 6 |
2 files changed, 9 insertions, 8 deletions
@@ -1,9 +1,8 @@ # sample macli configuration file # can be placed (and accessed in the same order) -# at ./macli.yaml, ~/.config/macli/macli.yaml or /etc/macli/macli.yaml +# at ./macli.toml, ~/.config/macli/macli.toml or /etc/macli/macli.toml # -# https://vidhukant.xyz/docs/macli -# https://github.com/MikunoNaka/macli +# https://git.vidhukant.com/macli # AUTHENTICAITON INFO # macli defaults to the system keyring on windows or mac, @@ -23,16 +22,18 @@ save_client_id = "yes" # set this to true if you do not wanna use the system kerying (unsafe) no_system_keyring = false # `macli login -k` works similarly +[global] +# NSFW rated search results and list items +nsfw = true + # default settings (can be overridden by corresponding flags, `macli --help` for more details) [searching] prompt_length = 5 # length of anime/manga selection prompt when searching (default: 5) search_length = 10 # amount of search results to get (default: 10) search_offset = 0 # offset for the search results (default is 0, changing it is here not recommended as it may cause confusion) -search_nsfw = false # include NSFW rated search results (true/false) auto_select_n = 0 # automatically select nth option while searching (0 means disabled) [lists] # TODO: add default sort types, etc list_length = 15 # amount of titles to show from user's list list_offset = 0 # offset for the results (default is 0, changing it here is not recommended as it may cause confusion) -include_nsfw_results = false # show NSFW rated items diff --git a/util/bind_config.go b/util/bind_config.go index ece5c2e..8a62877 100644 --- a/util/bind_config.go +++ b/util/bind_config.go @@ -1,6 +1,6 @@ /* macli - Unofficial CLI-Based MyAnimeList Client -Copyright © 2022 Vidhu Kant Sharma <vidhukant@vidhukant.xyz> +Copyright © 2022-2024 Vidhu Kant Sharma <vidhukant@vidhukant.xyz> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -82,7 +82,7 @@ func BindSearchConfig(flags *pflag.FlagSet) (SearchConfig, error) { conf.SearchNSFW, err = flags.GetBool("search-nsfw") if err != nil {return conf, err} } else { - conf.SearchNSFW = viper.GetBool("searching.search_nsfw") + conf.SearchNSFW = viper.GetBool("global.nsfw") } return conf, nil @@ -113,7 +113,7 @@ func BindListConfig(flags *pflag.FlagSet) (ListConfig, error) { conf.IncludeNSFW, err = flags.GetBool("include-nsfw") if err != nil {return conf, err} } else { - conf.IncludeNSFW = viper.GetBool("lists.include_nsfw_results") + conf.IncludeNSFW = viper.GetBool("global.nsfw") } return conf, nil |