Moved the check for availability of downloading functionality

This commit is contained in:
Veloman Yunkan 2024-05-30 13:49:56 +04:00 committed by Kelson
parent f8a140404e
commit 04a6d6c05a
2 changed files with 3 additions and 3 deletions

View File

@ -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();

View File

@ -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<std::pair<std::string, std::string>> DownloadOptions;
const std::string& url = book.getUrl();