Skip to content

Commit c1fd866

Browse files
committed
feat: [#488] return an error in the torrent details endpoint when user tracker keys can't be generated
1 parent b41488b commit c1fd866

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/services/torrent.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,7 @@ impl Index {
367367
// Add main tracker URL
368368
match opt_user_id {
369369
Some(user_id) => {
370-
// If no user owned tracker key can be found, use default tracker url
371-
// code-review: for downloading the torrent file it returns an error
372-
// instead of defaulting to the default tracker URL.
373-
let personal_announce_url = self
374-
.tracker_service
375-
.get_personal_announce_url(user_id)
376-
.await
377-
.unwrap_or(tracker_url);
370+
let personal_announce_url = self.tracker_service.get_personal_announce_url(user_id).await?;
378371

379372
torrent_response.include_url_as_main_tracker(&personal_announce_url);
380373
}

0 commit comments

Comments
 (0)