From 04a6d6c05a2296fc146a32149807e9a7cd773254 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Thu, 30 May 2024 13:49:56 +0400 Subject: [PATCH] Moved the check for availability of downloading functionality --- src/contentmanager.cpp | 3 --- src/downloadmanagement.cpp | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/contentmanager.cpp b/src/contentmanager.cpp index a65a592..8e5aa25 100644 --- a/src/contentmanager.cpp +++ b/src/contentmanager.cpp @@ -597,9 +597,6 @@ QString ContentManager::getRemoteLibraryUrl() const void ContentManager::downloadBook(const QString &id) { - if ( ! DownloadManager::downloadingFunctionalityAvailable() ) - throwDownloadUnavailableError(); - const auto& book = getRemoteOrLocalBook(id); const auto downloadPath = getSettingsManager()->getDownloadDir(); diff --git a/src/downloadmanagement.cpp b/src/downloadmanagement.cpp index 63ae5bd..e6cc447 100644 --- a/src/downloadmanagement.cpp +++ b/src/downloadmanagement.cpp @@ -137,6 +137,9 @@ DownloadInfo DownloadManager::getDownloadInfo(QString bookId) const std::string DownloadManager::startDownload(const kiwix::Book& book, const std::string& downloadDirPath) { + if ( ! DownloadManager::downloadingFunctionalityAvailable() ) + throw std::runtime_error("Downloading functionality is not available"); + typedef std::vector> DownloadOptions; const std::string& url = book.getUrl();