File tree 1 file changed +5
-6
lines changed
src/web/api/server/v1/contexts/torrent
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,9 @@ pub async fn download_torrent_handler(
77
77
78
78
debug ! ( "Downloading torrent: {:?}" , info_hash. to_hex_string( ) ) ;
79
79
80
- if let Some ( redirect_response) = redirect_to_download_url_using_canonical_info_hash_if_needed ( & app_data, & info_hash) . await {
80
+ if let Some ( redirect_response) =
81
+ redirect_to_download_url_using_canonical_info_hash_if_needed ( & app_data, & info_hash, opt_user_id) . await
82
+ {
81
83
debug ! ( "Redirecting to URL with canonical info-hash" ) ;
82
84
redirect_response
83
85
} else {
@@ -101,12 +103,9 @@ pub async fn download_torrent_handler(
101
103
async fn redirect_to_download_url_using_canonical_info_hash_if_needed (
102
104
app_data : & Arc < AppData > ,
103
105
info_hash : & InfoHash ,
106
+ opt_user_id : Option < i64 > ,
104
107
) -> Option < Response > {
105
- match app_data
106
- . torrent_info_hash_repository
107
- . find_canonical_info_hash_for ( info_hash)
108
- . await
109
- {
108
+ match app_data. torrent_service . get_canonical_info_hash ( info_hash, opt_user_id) . await {
110
109
Ok ( Some ( canonical_info_hash) ) => {
111
110
if canonical_info_hash != * info_hash {
112
111
return Some (
You can’t perform that action at this time.
0 commit comments