diff --git a/src/api/api.cpp b/src/api/api.cpp index cddbca72..a4114f5f 100644 --- a/src/api/api.cpp +++ b/src/api/api.cpp @@ -29,6 +29,7 @@ #include "../backend/generators.h" #include "../backend/error.h" #include "../backend/streams.h" +#include "../backend/legacy-parser.h" #include @@ -238,11 +239,25 @@ BOSS_API unsigned int boss_load_lists (boss_db db, const char * const masterlist std::list temp; std::list userTemp; - try { - YAML::Node tempNode = YAML::LoadFile(masterlistPath); - temp = tempNode["plugins"].as< std::list >(); - tempNode = YAML::LoadFile(userlistPath); + try { + if (boost::algorithm::iends_with(masterlistPath, ".yaml")) { + YAML::Node tempNode = YAML::LoadFile(masterlistPath); + temp = tempNode["plugins"].as< std::list >(); + } else { + boost::filesystem::path p(masterlistPath); + Loadv2Masterlist(p, temp); + } + } catch (YAML::Exception& e) { + extMessageStr = e.what(); + return boss_error_parse_fail; + } catch (boss::error& e) { + extMessageStr = e.what(); + return boss_error_parse_fail; + } + + try { + YAML::Node tempNode = YAML::LoadFile(userlistPath); userTemp = tempNode["plugins"].as< std::list >(); } catch (YAML::Exception& e) { extMessageStr = e.what(); diff --git a/src/backend/legacy-parser.h b/src/backend/legacy-parser.h index e54677e4..3dc3e143 100644 --- a/src/backend/legacy-parser.h +++ b/src/backend/legacy-parser.h @@ -421,7 +421,7 @@ namespace boss { //BOSSv2 supports Chinese and German in addition to English, Russian and Spanish, but they aren't used in any of the masterlists so don't bother mapping them. unsigned int langInt; if (lang == "english") - langInt = g_lang_any; + langInt = g_lang_english; else if (lang == "russian") langInt = g_lang_russian; else if (lang == "spanish")