diff --git a/tv_rename.cpp b/tv_rename.cpp index 0f3e15a..afb0c1c 100644 --- a/tv_rename.cpp +++ b/tv_rename.cpp @@ -262,9 +262,9 @@ getRenamedFiles( const string &show, int season, const string id, return renamed_files; } -std::vector< std::pair< string, string > > getLangs() { +std::map< string, string > getLangs() { Request &request = _tv_rename_request; - std::vector< std::pair< string, string > > langs; + std::map< string, string > langs; request.addHeader( TEXT( "Accept: application/json" ) ); request.addHeader( TEXT( "Authorization: Bearer " ) + _tv_rename_api_token ); @@ -273,9 +273,8 @@ std::vector< std::pair< string, string > > getLangs() { request.clearHeader(); rapidjson::Value &lang_data = d["data"]; for ( size_t i = 0; i < lang_data.Size(); i++ ) { - langs.emplace_back( - toString( lang_data[i]["abbreviation"].GetString() ), - toString( lang_data[i]["name"].GetString() ) ); + langs[ toString( lang_data[i]["abbreviation"].GetString() ) ] = + toString( lang_data[i]["name"].GetString() ); } return langs; } diff --git a/tv_rename.hpp b/tv_rename.hpp index 01e791f..bfa0142 100644 --- a/tv_rename.hpp +++ b/tv_rename.hpp @@ -46,7 +46,7 @@ getRenamedFiles( const string &show, int season, const string id, const bool &linux, const std::map< int, string > &files, bool dvd = false ); -std::vector< std::pair< string, string > > getLangs(); +std::map< string, string > getLangs(); #else