v3.0.1: can use search Name and -u && fix errors

This commit is contained in:
Markus 2019-10-04 20:24:51 +02:00
parent 43aff4b348
commit 192433cbb7
3 changed files with 13 additions and 7 deletions

View File

@ -151,6 +151,7 @@ int loadDefaulOptions(Settings &settings)
ofs << "#default-maxThreads=0" << std::endl;
ofs << std::endl;
ofs << "#search-AchteAufGroßUndKleinschreibung=false" << std::endl;
ofs << "#Mit 0 Können Sie die Warnung deaktivieren:" << std::endl;
ofs << "#search-UpdateWarnungNachTagen=10" << std::endl;



View File

@ -50,8 +50,8 @@ struct Settings {
proxy_ip = "127.0.0.1",
languages = "GerDub,GerSub,Eng",
genaueHoster = "",
version = "3.0.0",
defaultFileVersion="1.4",
version = "3.0.1",
defaultFileVersion="1.5",
outputFilePath = "",
default_checkPath = "",
default_Searchmuster = "S%Staffel%E%Folge%";

View File

@ -167,12 +167,13 @@ int ProgramManager::checkLastUpdate(Settings *settings)
return 1;
}
std::string line;
ssize_t difDays = 0;
if(!std::getline(ifs, line).good()) {
perror("GetLine from Date failed");
return 2;

} else if( ( static_cast<long long>(pageManager.getDate()) - atoll(line.c_str()) ) >= settings->updateWarningDays) {
std::cout << ((settings->colorless) ? "" : "\033[93m") << " => Warnung: SerienListe zuletzt vor " << settings->updateWarningDays << " Tagen aktualisiert."
} else if( ( ( difDays = static_cast<long long>(pageManager.getDate()) - atoll(line.c_str()) )) >= settings->updateWarningDays) {
std::cout << ((settings->colorless) ? "" : "\033[93m") << " => Warnung: SerienListe wurde zuletzt vor " << difDays << " Tagen aktualisiert."
<< std::endl << " Mit '" << settings->programName << " search -u' kannst du die Liste aktualisieren." << "\033[0m" << std::endl;;
}

@ -397,11 +398,15 @@ int ProgramManager::searchModus(Settings *settings, std::string *saveTo)
{
if(settings->search_wantUpdate) {
int res = searchModus_update(settings) ;
if( res == 0)
if(res == 0) {
std::cout << "Erfolgreich geupdatet: Die Serienliste ist nun auf dem neusten Stand." << std::endl;
else
if (settings->name == "")
return 0;

} else {
std::cout << " => Error: Das updaten der Serienliste ist fehlgeschlagen." << std::endl;
return res;
return res;
}

} else if(settings->name == "") {
std::cout << " => Error: Kein Name angegeben." << std::endl;