3.4.5: add colors to info function

This commit is contained in:
Markus 2019-10-30 16:32:30 +01:00
parent 5cdd485b4f
commit a450f87e0d
2 changed files with 19 additions and 15 deletions

View File

@ -63,7 +63,7 @@ struct Settings {
proxy_ip = "127.0.0.1",
languages = "GerDub,GerSub,Eng,",
genaueHoster = "",
version = "3.4.4",
version = "3.4.5",
defaultFileVersion="1.6",
outputFilePath = "",
default_checkPath = "",

View File

@ -739,7 +739,12 @@ int ProgramManager::infoModus(Settings *settings)
}

int gesammtFolge = 0;

std::string green = ((settings->colorless) ? "" : "\033[92m"),
lila = ((settings->colorless) ? "" : "\033[95m"),
Lightyellow = ((settings->colorless) ? "" : "\033[93m"),
Darkyellow = ((settings->colorless) ? "" : "\033[33m"),
blue = ((settings->colorless) ? "" : "\033[96m"),
white = "\033[0m";
//speicher (zahl -1), ab da wo /staffel-x nicht mehr vorkommt
int maxStaffel = pageManager.counterContains(tmp_reply.html, "/staffel-%i");

@ -753,7 +758,7 @@ int ProgramManager::infoModus(Settings *settings)
}

std::cout << std::endl
<< "Die Staffel " << staffel << " hat " << pageManager.counterContains(tmpReply.html, "/episode-%i") << " Folge(n)." << std::endl
<< green << "Die Staffel " << staffel << " hat " << pageManager.counterContains(tmpReply.html, "/episode-%i") << " Folge(n)." << white << std::endl
<< std::endl;

std::string html = tmpReply.html;
@ -774,6 +779,7 @@ int ProgramManager::infoModus(Settings *settings)

std::stringstream folgenListe(html);
std::string line;

while (std::getline(folgenListe, line).good()) {
std::string titel;
gesammtFolge = gesammtFolge + 1;
@ -787,9 +793,9 @@ int ProgramManager::infoModus(Settings *settings)
std::cout << " => Error: Konnte Position von ' </a>' nicht finden." << std::endl;
return 44;
}
std::cout << "Ep. " << ( (gesammtFolge < 100) ? ( (gesammtFolge < 10) ? "00" : "0" ) : "" ) << gesammtFolge
<< " ( S" << ( (staffel < 10) ? "0" : "" ) << staffel
<< "E" << ( ( atoi( line.substr(0, pos).c_str() ) < 10) ? "0" : "" ) << line.substr(0, pos) << " ):" <<std::endl;
std::cout << lila << "Ep. " << blue << ( (gesammtFolge < 100) ? ( (gesammtFolge < 10) ? "00" : "0" ) : "" ) << gesammtFolge << lila
<< " ( " << blue << "S" << ( (staffel < 10) ? "0" : "" ) << staffel
<< "E" << ( ( atoi( line.substr(0, pos).c_str() ) < 10) ? "0" : "" ) << line.substr(0, pos) << lila << " ):" << white <<std::endl;

if( (pos = line.find("<strong>")) == std::string::npos) {
std::cout << " => Error: Konnte Position von '<strong>' nicht finden." << std::endl;
@ -802,7 +808,7 @@ int ProgramManager::infoModus(Settings *settings)
}
titel = line.substr(0, pos);
if(titel != "")
std::cout << " > Titel 1: " << titel << std::endl;
std::cout << lila << " > Titel 1: " << Lightyellow << titel << white << std::endl;

if( (pos = line.find("<span>")) == std::string::npos) {
std::cout << " => Error: Konnte Position von '<span>' nicht finden." << std::endl;
@ -815,7 +821,7 @@ int ProgramManager::infoModus(Settings *settings)
}
titel = line.substr(0, pos);
if(titel != "")
std::cout << " > Titel 2: " << titel << std::endl;
std::cout << lila << " > Titel 2: " << Darkyellow << titel << white << std::endl;
}

}
@ -907,16 +913,14 @@ int ProgramManager::infoModus(Settings *settings)
std::string coverLink = line.substr(pos + 10, pos2 - pos -10);




std::cout << "Produktion von " << startStopDates[0] << " bis " << startStopDates[1] << std::endl
<< "FSK: " << fsk << std::endl
<< "Cover Bild: " << coverLink << std::endl
<< "Genre(s): " << std::flush;
std::cout << lila << "Produktion von " << blue << startStopDates[0] << lila << " bis " << blue << startStopDates[1] << lila << std::endl
<< "FSK: " << blue << fsk << lila << std::endl
<< "Cover Bild: " << green << coverLink << lila << std::endl
<< "Genre(s): " << blue << std::flush;
for( const auto &e : genres)
std::cout << e << " ";

std::cout << std::endl << "\nBeschreibung: " << description << std::endl;
std::cout << lila << std::endl << "\nBeschreibung: " << green << description << white << std::endl;


if(settings->debugMode)