- yhook: remove unnecessary line feeds from plain output; ...

align control/getbouquet
This commit is contained in:
svenhoefer
2016-02-21 01:29:17 +01:00
parent 1c73ca39e7
commit 89e0ba1a41
2 changed files with 19 additions and 14 deletions

View File

@@ -1203,7 +1203,7 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) {
bool encode = false;
std::string result = "";
TOutType outType = hh->outStart(true /*old mode*/);
TOutType outType = hh->outStart();
if (hh->ParamList["showhidden"] == "false")
show_hidden = false;
@@ -1241,9 +1241,13 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) {
bouquet = std::string(g_bouquetManager->Bouquets[i]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : g_bouquetManager->Bouquets[i]->Name.c_str());
if (encode)
bouquet = encodeString(bouquet); // encode (URLencode) the bouquetname
item = hh->outPair("number", string_printf("%u", i + 1), true);
if(outType == plain) item+= " ";
item += hh->outPair("name", bouquet, false);
if (outType == plain)
item = string_printf("%u", i + 1) + " " + bouquet + "\n";
else
{
item = hh->outPair("number", string_printf("%u", i + 1), true);
item += hh->outPair("name", bouquet, false);
}
result += hh->outArrayItem("bouquet", item, (i < size-1));
}
}