Added warnings for missing dependencies
This commit is contained in:
parent
db707b794b
commit
e2338f423c
@ -31,6 +31,8 @@ std::string DownloadManager::QueueDownload(std::string url, DOWNLOAD_MODE mode)
|
||||
newDownload.queued_timestamp = time(0);
|
||||
newDownload.download_url = "/download/" + newDownload.tubio_id;
|
||||
|
||||
WarnIfMissingDependenciesWIN();
|
||||
|
||||
if (!IsJsonValid(jsString))
|
||||
{
|
||||
newDownload.status = DOWNLOAD_STATUS::FAILED;
|
||||
@ -545,6 +547,37 @@ std::string DownloadManager::CreateNewTubioID()
|
||||
return newId;
|
||||
}
|
||||
|
||||
void DownloadManager::WarnIfMissingDependenciesWIN()
|
||||
{
|
||||
#ifdef _WIN
|
||||
if (!FileSystem::Exists("youtube-dl.exe"))
|
||||
{
|
||||
log->cout << log->Warn() << "Dependency youtube-dl.exe missing! Try updating it! (\"request\": \"update_dep_youtubedl\"). "
|
||||
<< "Dependencies HAVE to lie in Tubios working directory! (where the config.json is)";
|
||||
log->Flush();
|
||||
}
|
||||
if (!FileSystem::Exists("ffmpeg.exe"))
|
||||
{
|
||||
log->cout << log->Warn() << "Dependency ffmpeg.exe missing! (Get it here: https://www.gyan.dev/ffmpeg/builds/). "
|
||||
<< "Dependencies HAVE to lie in Tubios working directory! (where the config.json is)";
|
||||
log->Flush();
|
||||
}
|
||||
if (!FileSystem::Exists("ffplay.exe"))
|
||||
{
|
||||
log->cout << log->Warn() << "Dependency ffplay.exe missing! (Get it here: https://www.gyan.dev/ffmpeg/builds/). "
|
||||
<< "Dependencies HAVE to lie in Tubios working directory! (where the config.json is)";
|
||||
log->Flush();
|
||||
}
|
||||
if (!FileSystem::Exists("ffprobe.exe"))
|
||||
{
|
||||
log->cout << log->Warn() << "Dependency ffprobe.exe missing! (Get it here: https://www.gyan.dev/ffmpeg/builds/). "
|
||||
<< "Dependencies HAVE to lie in Tubios working directory! (where the config.json is)";
|
||||
log->Flush();
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
std::size_t DownloadManager::GetNumActiveDownloads()
|
||||
{
|
||||
std::size_t counter = 0;
|
||||
|
@ -102,6 +102,11 @@ namespace Downloader
|
||||
static void FetchInformation(std::string url, std::string tubId);
|
||||
static std::string CreateNewTubioID();
|
||||
|
||||
/// <summary>
|
||||
/// Will check for missing dependencies (windows only) and warn if missing
|
||||
/// </summary>
|
||||
static void WarnIfMissingDependenciesWIN();
|
||||
|
||||
static std::size_t GetNumActiveDownloads();
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user