forked from markus/S_New4
v3.0.1: can use search Name and -u && fix errors
This commit is contained in:
parent
43aff4b348
commit
192433cbb7
@ -151,6 +151,7 @@ int loadDefaulOptions(Settings &settings)
|
|||||||
ofs << "#default-maxThreads=0" << std::endl;
|
ofs << "#default-maxThreads=0" << std::endl;
|
||||||
ofs << std::endl;
|
ofs << std::endl;
|
||||||
ofs << "#search-AchteAufGroßUndKleinschreibung=false" << 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;
|
ofs << "#search-UpdateWarnungNachTagen=10" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,8 +50,8 @@ struct Settings {
|
|||||||
proxy_ip = "127.0.0.1",
|
proxy_ip = "127.0.0.1",
|
||||||
languages = "GerDub,GerSub,Eng",
|
languages = "GerDub,GerSub,Eng",
|
||||||
genaueHoster = "",
|
genaueHoster = "",
|
||||||
version = "3.0.0",
|
version = "3.0.1",
|
||||||
defaultFileVersion="1.4",
|
defaultFileVersion="1.5",
|
||||||
outputFilePath = "",
|
outputFilePath = "",
|
||||||
default_checkPath = "",
|
default_checkPath = "",
|
||||||
default_Searchmuster = "S%Staffel%E%Folge%";
|
default_Searchmuster = "S%Staffel%E%Folge%";
|
||||||
|
@ -167,12 +167,13 @@ int ProgramManager::checkLastUpdate(Settings *settings)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
std::string line;
|
std::string line;
|
||||||
|
ssize_t difDays = 0;
|
||||||
if(!std::getline(ifs, line).good()) {
|
if(!std::getline(ifs, line).good()) {
|
||||||
perror("GetLine from Date failed");
|
perror("GetLine from Date failed");
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
} else if( ( static_cast<long long>(pageManager.getDate()) - atoll(line.c_str()) ) >= settings->updateWarningDays) {
|
} else if( ( ( difDays = 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."
|
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;;
|
<< 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) {
|
if(settings->search_wantUpdate) {
|
||||||
int res = searchModus_update(settings) ;
|
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;
|
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;
|
std::cout << " => Error: Das updaten der Serienliste ist fehlgeschlagen." << std::endl;
|
||||||
return res;
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
} else if(settings->name == "") {
|
} else if(settings->name == "") {
|
||||||
std::cout << " => Error: Kein Name angegeben." << std::endl;
|
std::cout << " => Error: Kein Name angegeben." << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user