bugfix: it now downloads the entire collection

This commit is contained in:
Kaley, Fischer 2024-10-22 03:48:13 +02:00
parent e569cbb436
commit 1b015de156
5 changed files with 19 additions and 21 deletions

View file

@ -1,8 +1,8 @@
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
C++ 4 320 253 20 47
C++ Header 4 67 54 5 8
C++ 4 319 251 21 47
C++ Header 4 66 53 5 8
===============================================================================
Total 8 387 307 25 55
Total 8 385 304 26 55
===============================================================================

View file

@ -1,5 +1,3 @@
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include "regex"
@ -41,9 +39,7 @@ void Regex(cmd *inputCmd) {
// Step 6: Write "+quit" at the end of the output buffer
inputCmd->ids += "+quit\n";
}
}
void slashing(cmd *inputCmd) {
std::istringstream inputStream(inputCmd->ids);
std::string line;
@ -51,5 +47,4 @@ void slashing(cmd *inputCmd) {
while (std::getline(inputStream, line)) {
inputCmd->slashtp++;
}
inputCmd->slash = (inputCmd->slashtp == 2) ? R"( )": R"( \ )";
}

View file

@ -30,5 +30,4 @@ int totalmeow = 0;
};
void Regex(cmd *inputCmd);
void slashing(cmd *inputCmd);
#endif

View file

@ -142,7 +142,6 @@ int main(int argc, char **argv, char **envp) {
// main functions
Regex(&inputCmd);
slashing(&inputCmd);
maincommand(&inputCmd);
return 1;

View file

@ -1,5 +1,7 @@
#include <fstream>
#include <iostream>
#include <stdexcept>
#include <string>
#include <thread>
#include <chrono>
#include <atomic>
@ -30,6 +32,9 @@ void execAndDisplay(cmd *inputCmd, const std::string& cmd, std::atomic<bool>& ru
// checks for errors.
if (line.find("ERROR!") != std::string::npos) {
inputCmd->errors++;
// tmp fix for errors.
std::ofstream meow{"/home/rander/.cache/errors.txt"};
meow << "start:\n" + line;
}
inputCmd->totalmeow++;
@ -57,10 +62,9 @@ void maincommand(cmd *inputCmd) {
+ inputCmd->dir
+ " +login "
+ inputCmd->user
+ inputCmd->pass
+ inputCmd->slash
+ idsm
+ inputCmd->ids}.c_str();
+ ((inputCmd->pass.empty()) ? "" : inputCmd->pass)
+ " "
+ ((inputCmd->ab == 1) ? idsm: inputCmd->ids)}.c_str();
try {
std::atomic<bool> running(true);
@ -78,8 +82,9 @@ void maincommand(cmd *inputCmd) {
std::string colm = (inputCmd->ab == 1) ? R"(Mod)": R"(Collection)";
// shows how much and what has downloaded
std::string mods = total + "\n"
+ "Finished: " + std::to_string(inputCmd->successes +1) + "\n"
std::string mods = total
+ "\n"
+ "Finished: " + std::to_string(inputCmd->successes) + "\n"
+ "Timed out: " + std::to_string(inputCmd->timedout) + "\n"
+ "Errored: " + std::to_string(inputCmd->errors) + "\n" + "\n";