diff --git a/src/contentmanager.cpp b/src/contentmanager.cpp index c9c921f..a65a592 100644 --- a/src/contentmanager.cpp +++ b/src/contentmanager.cpp @@ -595,14 +595,6 @@ QString ContentManager::getRemoteLibraryUrl() const : "http://" + host + ":" + QString::number(port); } -std::string ContentManager::startDownload(const kiwix::Book& book) -{ - auto downloadPath = getSettingsManager()->getDownloadDir(); - checkThatBookCanBeSaved(book, downloadPath); - - return DownloadManager::startDownload(book, downloadPath.toStdString()); -} - void ContentManager::downloadBook(const QString &id) { if ( ! DownloadManager::downloadingFunctionalityAvailable() ) @@ -610,11 +602,12 @@ void ContentManager::downloadBook(const QString &id) const auto& book = getRemoteOrLocalBook(id); + const auto downloadPath = getSettingsManager()->getDownloadDir(); + checkThatBookCanBeSaved(book, downloadPath); + std::string downloadId; try { - downloadId = startDownload(book); - } catch (const ContentManagerError& ) { - throw; + downloadId = DownloadManager::startDownload(book, downloadPath.toStdString()); } catch (std::exception& e) { throwDownloadUnavailableError(); } diff --git a/src/contentmanager.h b/src/contentmanager.h index c51b319..939db91 100644 --- a/src/contentmanager.h +++ b/src/contentmanager.h @@ -121,7 +121,6 @@ private: // functions const kiwix::Book& getRemoteOrLocalBook(const QString &id); QString getRemoteLibraryUrl() const; - std::string startDownload(const kiwix::Book& book); void removeDownload(QString bookId); void downloadStarted(const kiwix::Book& book, const std::string& downloadId); void downloadDisappeared(QString bookId);