This commit is contained in:
Markus 2019-08-21 16:31:17 +02:00
parent fa77193d79
commit 81d4a9f6f4
2 changed files with 23 additions and 21 deletions

View File

@ -37,7 +37,7 @@ struct Settings {
proxy_ip = "127.0.0.1",
languages = "GerDub,GerSub,Eng",
genaueHoster = "Vivo,GoUnlimited",
version = "2.3.1",
version = "2.3.2",
defaultFileVersion="1.3",
outputFilePath = "",
default_checkDirPath = "",

View File

@ -111,6 +111,24 @@ void * threadFunction(void * data) {

}

int ProgramManager::waitForThreads()
{
for( auto &e : threadList) {
if( e->exitState != -1 && pthread_join(e->thread, nullptr) == 0) {
if(e->exitState != 0) {
std::cout << "\33[2K\r => Error: Thread gab error zurück." << std::endl;
return e->exitState;
} else
if(e->returnValue != "")
std::cout << ("\33[2K\r(T" + std::to_string(e->id) + ")" + e->returnValue ) << std::endl;
}
e->exitState = -1;
e->returnValue = "";
e->setData(0, 0);
e->thread = 0;
}
return 0;
}

int ProgramManager::defaultModus(Settings *settings)
{
@ -296,26 +314,6 @@ int ProgramManager::defaultModus(Settings *settings)
return 0;
}

int ProgramManager::waitForThreads()
{
for( auto &e : threadList) {
if( e->exitState != -1 && pthread_join(e->thread, nullptr) == 0) {
if(e->exitState != 0) {
std::cout << "\33[2K\r => Error: Thread gab error zurück." << std::endl;
return e->exitState;
} else
if(e->returnValue != "")
std::cout << ("\33[2K\r(T" + std::to_string(e->id) + ")" + e->returnValue ) << std::endl;
}
e->exitState = -1;
e->returnValue = "";
e->setData(0, 0);
e->thread = 0;
}
return 0;
}


int ProgramManager::directLinkModus(Settings *settings)
{
AccountManager accountManager(settings->accountFilePath, settings->accountNumberPath);
@ -451,6 +449,8 @@ int ProgramManager::infoModus(Settings *settings)
return 40;
std::cout << " > Die Staffel " << staffel << " hat " << pageManager.counterContains(tmp_reply.html, "/episode-%i") << " Folge(n)." << std::endl;



}

//Datum & FSK
@ -463,6 +463,7 @@ int ProgramManager::infoModus(Settings *settings)
std::string startStopDates[2];
size_t pos = 0, pos2 = 0;

//Date
for (int i = 0; i < 2; ++i) {
if( (pos = line.find("href=")) == std::string::npos ) {
std::cout << " => Error: Konnte 'href=' nicht finden." << std::endl;
@ -480,6 +481,7 @@ int ProgramManager::infoModus(Settings *settings)
startStopDates[i] = line.substr(pos + 1, pos2 - pos -1);
}

//FSK
if( (pos = line.find("data-fsk=\"")) == std::string::npos ) {
std::cout << " => Error: Konnte 'data-fsk=\"' nicht finden." << std::endl;
return 87;