v5.0.1: fixes + remove als default print all names

This commit is contained in:
Your Name 2021-03-02 21:57:19 +01:00
parent 7914d80dbc
commit 891f9eaf87
3 changed files with 32 additions and 7 deletions

View File

@ -229,6 +229,12 @@ int loadDefaulOptions(Settings &settings)
ofs << "# -> Mit 0 Können Sie die Warnung deaktivieren:" << std::endl;
ofs << "#search_UpdateWarnungNachTagen=10" << std::endl << std::endl;

ofs << "# -> Aktiviert werden bei der Suche sämtliche Namen der Serie angezeigt." << std::endl;
ofs << "# Bei Animes kann das zu Mehrzeiligen ausgaben pro Serie führen!" << std::endl;
ofs << "#search-showAllNames=false" << std::endl << std::endl;



ofs.close();
}
ifs.open(settings.defaultsFilePath);
@ -366,8 +372,18 @@ int loadDefaulOptions(Settings &settings)
if(settings.debugMode)
std::cout << " > Defaults: UseFirstPage: " << settings.useFirstPage << std::endl;

} else if (what == "test") {
//test
} else if (what == "search-showAllNames") {

if(data == "true")
settings.search_show_othernames=true;
else if (data == "false")
settings.search_show_othernames=false;
else {
std::cout << " => Error_Defaults: search-showAllNames: Ungültiger Wert für 'true/false': " << data << std::endl;
return 2487;
}
if(settings.debugMode)
std::cout << " > Defaults: search-showAllNames: " << settings.search_show_othernames << std::endl;

} else {
std::cout << " => Warnung: Unbekannte Default-Option: '" << what << "'." << std::endl;
@ -885,6 +901,7 @@ int unterOption_search(Settings *settings, int argc, char **argv)
{"socks5-proxy", required_argument, nullptr, 'p'},
{"internet-pages", required_argument, nullptr, 'i'},

{"show-all-names", no_argument, nullptr, 's'},
{"help", no_argument, nullptr, 'h'},
{"colorless", no_argument, nullptr, 'c'},
{"debug-mode", no_argument, nullptr, 'd'},
@ -897,7 +914,7 @@ int unterOption_search(Settings *settings, int argc, char **argv)
};


while( ( c = getopt_long (argc, argv, "p:i:hcdeul", long_opts, nullptr) ) != -1 ) {
while( ( c = getopt_long (argc, argv, "p:i:shcdeul", long_opts, nullptr) ) != -1 ) {
switch(c) {
case 'p':
if(!optarg || setS5ProxytoSettings(*settings, optarg) != 0)
@ -912,6 +929,11 @@ int unterOption_search(Settings *settings, int argc, char **argv)
case 'h':
unterOption_search_help(settings->programName);
return -1;
case 's':
settings->search_show_othernames = true;
if(settings->debugMode)
std::cout << "search_show_othernames: true" << std::endl;
break;
case 'c':
settings->colorless = true;
if(settings->debugMode)
@ -1005,6 +1027,9 @@ void unterOption_search_help(std::string programName)
<< " Serienliste zuletzt aktualisiert wurde." << std::endl << std::endl
<< " -c, --colorless" << std::endl
<< " Mit dieser Option kann man die farbige Ausgabe ausstellen." << std::endl << std::endl
<< " -s, --show-all-names" << std::endl
<< " Mit dieser Option werden alle Namen einer Serie ausgegeben." << std::endl << std::endl
<< " Vorsicht bei Animes: Kann zu mehrzeiligen Ausgaben pro Serie führen!" << std::endl << std::endl
<< " -d, --debug-mode" << std::endl
<< " Mit dieser Option kann man den Debug-Modus einschalten." << std::endl
<< " Dabei werden vielmehr Infos ausgegeben." << std::endl << std::endl

View File

@ -26,7 +26,7 @@

#define UpdaterCloudUrlWithPath "https://cloud.obermui.de/s/tXz7SWdaPJ7TacZ/download?path=%2F&files="
#define SecondUpdaterCloudUrlWithPath "https://snew4.obermui.de/download?path=%2F&files="
#define VERSION "5.0.0"
#define VERSION "5.0.1"


//default, anime, normal,
@ -138,6 +138,7 @@ struct Settings {
debugMode = false,
search_IgnoreUpperLower = true,
search_wantUpdate = false,
search_show_othernames = false,
askForEveryDir = true,
skipEpisodenNameOutput = false,
showLastUpdate = false;

View File

@ -239,7 +239,7 @@ int ProgramManager::sucheNach_1_Serien(Settings *settings, PageManager &pageMana
std::cout << " => Error: Invalid Line: " << line << std::endl;
return -21;
}
std::cout << "[" << i << "]: " << line.substr(line.find_last_of("|") + 1) << ( (line[0] != '|') ? " ( " + line.substr(0, line.find("|")) + " )" : "" ) << std::endl;
std::cout << "[" << i << "]: " << line.substr(line.find_last_of("|") + 1) << ( (settings->search_show_othernames && line[0] != '|') ? " ( " + line.substr(0, line.find("|")) + " )" : "" ) << std::endl;
}

//Lass Benutzer Zeile auswählen:
@ -852,7 +852,6 @@ int ProgramManager::searchModus(Settings *settings, std::string *saveTo, bool no

while (std::getline(ifS, l)) {
if( l.find_last_of('|') == std::string::npos ) {
std::cout << "Invalid Line: '" << l << "'" << std::endl;
continue;
} else if( allUrls.find( l.substr(l.find_last_of('|') + 1) ) != std::string::npos )
finds += l + "\n";
@ -909,7 +908,7 @@ int ProgramManager::searchModus(Settings *settings, std::string *saveTo, bool no
}

std::cout << " > " << parts.at(2) << "\t[" << parts.at(1).erase(0, 1) << "]"
<< ( (line[0] == '|') ? "" : "\t( " + parts.at(0) + " )" ) << std::endl;
<< ( ( !settings->search_show_othernames || line[0] == '|') ? "" : "\t( " + parts.at(0) + " )" ) << std::endl;
//zähne hoch!!

///That Time I Got Reincarnated as a Slime|/tensei-shitara-slime-datta-ken|Tensei Shitara Slime Datta Ken|ANIME