@@ -67,14 +67,14 @@ cpp::result<void, std::string> DownloadService::AddDownloadTask(
6767 std::optional<std::string> dl_err_msg = std::nullopt ;
6868 for (const auto & item : task.items ) {
6969 CLI_LOG (" Start downloading: " + item.localPath .filename ().string ());
70- auto result = Download (task.id , item, true , task. type );
70+ auto result = Download (task.id , item, true );
7171 if (result.has_error ()) {
7272 dl_err_msg = result.error ();
7373 break ;
7474 }
7575 }
7676 if (dl_err_msg.has_value ()) {
77- CTL_ERR (dl_err_msg.value ());
77+ // CTL_ERR(dl_err_msg.value());
7878 return cpp::fail (dl_err_msg.value ());
7979 }
8080
@@ -121,7 +121,7 @@ cpp::result<void, std::string> DownloadService::AddAsyncDownloadTask(
121121 std::optional<std::string> dl_err_msg = std::nullopt ;
122122 for (const auto & item : task.items ) {
123123 CTL_INF (" Start downloading: " + item.localPath .filename ().string ());
124- auto result = Download (task.id , item, false , task. type );
124+ auto result = Download (task.id , item, false );
125125 if (result.has_error ()) {
126126 dl_err_msg = result.error ();
127127 break ;
@@ -147,7 +147,7 @@ cpp::result<void, std::string> DownloadService::AddAsyncDownloadTask(
147147
148148cpp::result<void , std::string> DownloadService::Download (
149149 const std::string& download_id, const DownloadItem& download_item,
150- bool allow_resume, std::optional<DownloadType> download_type ) noexcept {
150+ bool allow_resume) noexcept {
151151 CTL_INF (" Absolute file output: " << download_item.localPath .string ());
152152
153153 CURL* curl;
@@ -183,7 +183,7 @@ cpp::result<void, std::string> DownloadService::Download(
183183 CLI_LOG (" Resuming download.." );
184184 } else {
185185 CLI_LOG (" Start over.." );
186- return {} ;
186+ return cpp::fail ( " Cancelled Resume download! " ) ;
187187 }
188188 } else {
189189 CLI_LOG (download_item.localPath .filename ().string ()
@@ -195,7 +195,7 @@ cpp::result<void, std::string> DownloadService::Download(
195195 if (answer == " Y" || answer == " y" || answer.empty ()) {
196196 CLI_LOG (" Re-downloading.." );
197197 } else {
198- return {} ;
198+ return cpp::fail ( " Cancelled Re-download! " ) ;
199199 }
200200 }
201201 }
@@ -232,9 +232,6 @@ cpp::result<void, std::string> DownloadService::Download(
232232
233233 fclose (file);
234234 curl_easy_cleanup (curl);
235- if (download_type.has_value () && download_type == DownloadType::Model) {
236- CLI_LOG (" Model " << download_id << " downloaded successfully!" )
237- }
238235 return {};
239236}
240237
0 commit comments