update download's status when we get it

This commit is contained in:
luddens 2019-05-02 14:12:02 +02:00 committed by Matthieu Gautier
parent 8698407e1e
commit 12ffad55f7
1 changed files with 2 additions and 0 deletions

View File

@ -139,11 +139,13 @@ Download* Downloader::startDownload(const std::string& uri)
Download* Downloader::getDownload(const std::string& did)
{
try {
m_knownDownloads.at(did).get()->updateStatus(true);
return m_knownDownloads.at(did).get();
} catch(exception& e) {
for (auto gid : mp_aria->tellActive()) {
if (gid == did) {
m_knownDownloads[gid] = std::unique_ptr<Download>(new Download(mp_aria, gid));
m_knownDownloads.at(gid).get()->updateStatus(true);
return m_knownDownloads[gid].get();
}
}