Commit ca439d87 authored by nanahira's avatar nanahira

Merge branch 'mc'

parents eb2e1c2e 9ea82a4b
......@@ -143,7 +143,9 @@
"post_detailed_score": true,
"post_score_midduel": true,
"cache_ttl": 60000,
"api_key": "123",
"options": {
"apiKey": "123"
},
"tournament_id": "456",
"use_custom_module": false
},
......
......@@ -304,6 +304,11 @@ if settings.hostinfo.enable_priority or settings.hostinfo.enable_priority == fal
settings.hostinfo.duel_rule = 4
delete settings.hostinfo.enable_priority
imported = true
#import the old Challonge api key option
if settings.modules.challonge.api_key
settings.modules.challonge.options.apiKey = settings.modules.challonge.api_key
delete settings.modules.challonge.api_key
imported = true
#finish
if imported
setting_save(settings)
......@@ -449,9 +454,7 @@ if settings.modules.challonge.enabled
challonge_module_name = 'challonge'
if settings.modules.challonge.use_custom_module
challonge_module_name = settings.modules.challonge.use_custom_module
challonge = require(challonge_module_name).createClient({
apiKey: settings.modules.challonge.api_key
})
challonge = require(challonge_module_name).createClient(settings.modules.challonge.options)
if settings.modules.challonge.cache_ttl
challonge_cache = []
challonge_queue_callbacks = [[], []]
......
......@@ -359,6 +359,12 @@
imported = true;
}
if (settings.modules.challonge.api_key) {
settings.modules.challonge.options.apiKey = settings.modules.challonge.api_key;
delete settings.modules.challonge.api_key;
imported = true;
}
if (imported) {
setting_save(settings);
}
......@@ -553,9 +559,7 @@
if (settings.modules.challonge.use_custom_module) {
challonge_module_name = settings.modules.challonge.use_custom_module;
}
challonge = require(challonge_module_name).createClient({
apiKey: settings.modules.challonge.api_key
});
challonge = require(challonge_module_name).createClient(settings.modules.challonge.options);
if (settings.modules.challonge.cache_ttl) {
challonge_cache = [];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment