From 1eed669a8ffd247d136addd3fdf1d4f6dd735098 Mon Sep 17 00:00:00 2001 From: Markus Date: Wed, 2 Oct 2019 22:13:15 +0200 Subject: [PATCH] v2.8.3: list new serien wehean update at s -u --- parameterManager.h | 2 +- programManager.cpp | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/parameterManager.h b/parameterManager.h index 94ee0ca..6b565c0 100644 --- a/parameterManager.h +++ b/parameterManager.h @@ -47,7 +47,7 @@ struct Settings { proxy_ip = "127.0.0.1", languages = "GerDub,GerSub,Eng", genaueHoster = "", - version = "2.8.2", + version = "2.8.3", defaultFileVersion="1.3", outputFilePath = "", default_checkPath = "", diff --git a/programManager.cpp b/programManager.cpp index dd7eddf..7e18833 100644 --- a/programManager.cpp +++ b/programManager.cpp @@ -748,6 +748,16 @@ int ProgramManager::searchModus_update(Settings *settings) for(countBef = 0; std::getline(myFileBef,line); ++countBef); myFileBef.close(); + //Speicher für Vergleich Alte liste: + std::ifstream t(settings->serienListPath); + if(!t.is_open()) { + perror("Konnte SerienListe-Datei nicht öffnen"); + return 110; + } + std::string alte_list((std::istreambuf_iterator(t)), + std::istreambuf_iterator()); + t.close(); + //Schreibe die Liste in das TextFile std::ofstream ofs(settings->serienListPath, std::ios::trunc); if(!ofs.is_open()) { @@ -764,6 +774,16 @@ int ProgramManager::searchModus_update(Settings *settings) for(countAf = 0; std::getline(myFileAf,line); ++countAf); myFileAf.close(); + + //Vergleiche alte/Neue Liste: + + std::stringstream newStrStr(serienListe.c_str()); + while (std::getline(newStrStr, line).good()) { + if(line != "" && alte_list.find(line) == std::string::npos) { + std::cout << "Neu: '" << line.substr(line.find_last_of("|") + 1) << "'" << std::endl; + } + } + std::cout << "Serienunterschied: " << ( ((countAf - countBef) > 0) ? "+" : "") << countAf - countBef << " Serien." << std::endl; return 0; }