tv_rename: getLangs returns map instead of vector of pairs
This commit is contained in:
parent
2a4b7c60ae
commit
7f69b3c662
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user