aboutsummaryrefslogtreecommitdiff
path: root/mal
diff options
context:
space:
mode:
Diffstat (limited to 'mal')
-rw-r--r--mal/mal.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/mal/mal.go b/mal/mal.go
index 670be07..04cce45 100644
--- a/mal/mal.go
+++ b/mal/mal.go
@@ -61,6 +61,7 @@ func Init() {
confSearchLength := viper.Get("searching.search_length")
confSearchOffset := viper.Get("searching.search_offset")
confSearchNsfw := viper.Get("searching.search_nsfw")
+ confSecret := viper.Get("auth.token")
// if SearchLength is the default value just use the one in config file if any
if confSearchLength != nil && SearchLength == 10 {
@@ -75,6 +76,12 @@ func Init() {
SearchNSFW = confSearchNsfw.(bool)
}
+ /* the secret stored in the config file
+ * takes precedence on the system keyring */
+ if confSecret != nil && confSecret != "" {
+ Secret = confSecret.(string)
+ }
+
// initialise MAL2Go Client(s)
animeClient.AuthToken = tk
mangaClient.AuthToken = tk