forked from markus/S_New4
add -s 0; last season
This commit is contained in:
parent
b4b1c90ca0
commit
c21df9cdfa
@ -385,9 +385,6 @@ int unterOption_default(Settings *settings, int argc, char ** argv)
|
|||||||
if (std::to_string(settings->startSeason) != optarg) {
|
if (std::to_string(settings->startSeason) != optarg) {
|
||||||
std::cout << "Error: -s [Staffel]: '" << optarg << "' ist keine Zahl." << std::endl;
|
std::cout << "Error: -s [Staffel]: '" << optarg << "' ist keine Zahl." << std::endl;
|
||||||
return 15;
|
return 15;
|
||||||
} else if (settings->startSeason == 0) {
|
|
||||||
std::cout << "Error: -s [Staffel]: StartStaffel ist 0." << std::endl;
|
|
||||||
return 16;
|
|
||||||
} else if (settings->startSeason < 0) {
|
} else if (settings->startSeason < 0) {
|
||||||
std::cout << "Error: -s [Staffel]: StartStaffel " << settings->startSeason << " ist kleiner 0." << std::endl;
|
std::cout << "Error: -s [Staffel]: StartStaffel " << settings->startSeason << " ist kleiner 0." << std::endl;
|
||||||
return 17;
|
return 17;
|
||||||
@ -513,8 +510,8 @@ void unterOption_default_help()
|
|||||||
<< " das Programm startet." << std::endl << std::endl
|
<< " das Programm startet." << std::endl << std::endl
|
||||||
<< " Standart: 1" << std::endl
|
<< " Standart: 1" << std::endl
|
||||||
<< " -s [Staffel], --start-season [Staffel]" << std::endl
|
<< " -s [Staffel], --start-season [Staffel]" << std::endl
|
||||||
<< " Mit dieser Option kann man festlegen, mit welcher Staffel" << std::endl
|
<< " Mit dieser Option kann man festlegen, mit welcher Staffel das" << std::endl
|
||||||
<< " das Programm startet." << std::endl
|
<< " Programm startet. Verwende 0 um mit der letzten Staffel zu starten." << std::endl
|
||||||
<< " Standart: 1" << std::endl << std::endl
|
<< " Standart: 1" << std::endl << std::endl
|
||||||
<< " -E [Folge], --stop-episode [Folge]" << std::endl
|
<< " -E [Folge], --stop-episode [Folge]" << std::endl
|
||||||
<< " Mit dieser Option kann man festlegen, mit welcher Folge" << std::endl
|
<< " Mit dieser Option kann man festlegen, mit welcher Folge" << std::endl
|
||||||
|
@ -206,7 +206,8 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
|
|
||||||
//Write Name to File if -o is set und kein TXT-FILE angegeben wird
|
//Write Name to File if -o is set und kein TXT-FILE angegeben wird
|
||||||
if(settings->outputFilePath != "" && !fileExists( settings->default_checkPath ))
|
if(settings->outputFilePath != "" && !fileExists( settings->default_checkPath ))
|
||||||
pageManager.writeToFile(settings->outputFilePath, "Name: " + settings->name);
|
if(pageManager.writeToFile(settings->outputFilePath, "Name: " + settings->name) != 0)
|
||||||
|
return 31;
|
||||||
|
|
||||||
//Finde die anzahl der staffel heraus:
|
//Finde die anzahl der staffel heraus:
|
||||||
//download html von der startpage einer serie
|
//download html von der startpage einer serie
|
||||||
@ -220,6 +221,8 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
std::cout << " > Die Serie " << settings->name << " hat " << maxStaffel << " Staffeln." << std::endl;
|
std::cout << " > Die Serie " << settings->name << " hat " << maxStaffel << " Staffeln." << std::endl;
|
||||||
|
|
||||||
//For every season
|
//For every season
|
||||||
|
if(settings->startSeason == 0)
|
||||||
|
settings->startSeason = maxStaffel;
|
||||||
for (int staffel = settings->startSeason; staffel <= maxStaffel; ++staffel) {
|
for (int staffel = settings->startSeason; staffel <= maxStaffel; ++staffel) {
|
||||||
//Test for stopping Program caused -E, -S
|
//Test for stopping Program caused -E, -S
|
||||||
if(staffel > settings->stopSeason && settings->stopSeason > 0) {
|
if(staffel > settings->stopSeason && settings->stopSeason > 0) {
|
||||||
@ -445,7 +448,7 @@ int ProgramManager::infoModus(Settings *settings)
|
|||||||
Reply tmpReply = pageManager.getServerRequest(pageManager.UrlPraefix + nameInUrl + "/staffel-" + std::to_string(staffel));
|
Reply tmpReply = pageManager.getServerRequest(pageManager.UrlPraefix + nameInUrl + "/staffel-" + std::to_string(staffel));
|
||||||
if(tmpReply.html == "-1")
|
if(tmpReply.html == "-1")
|
||||||
return 40;
|
return 40;
|
||||||
std::cout << " > Die Staffel " << staffel << " hat " << pageManager.counterContains(tmp_reply.html, "/episode-%i") << " Folge(n)." << std::endl;
|
std::cout << " > Die Staffel " << staffel << " hat " << pageManager.counterContains(tmpReply.html, "/episode-%i") << " Folge(n)." << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user