28 lines
422 B
C++
28 lines
422 B
C++
//
|
|
// Created by s-har on 25.05.2021.
|
|
//
|
|
#pragma once
|
|
#include <vector>
|
|
#include <string>
|
|
#include <thread>
|
|
|
|
#include <soci/session.h>
|
|
|
|
#include "tables.hpp"
|
|
|
|
class Worker
|
|
{
|
|
std::thread thread;
|
|
soci::session& sql;
|
|
|
|
std::string output_path = "./downloads";
|
|
public:
|
|
explicit Worker(soci::session& sql);
|
|
|
|
[[noreturn]] void loop();
|
|
|
|
private:
|
|
bool getTask(File& task);
|
|
|
|
bool download(File& task);
|
|
}; |