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 @@ -164,7 +164,9 @@ pub async fn get_torrent_info_handler(
164
164
return errors:: Request :: InvalidInfoHashParam . into_response ( ) ;
165
165
} ;
166
166
167
- if let Some ( redirect_response) = redirect_to_details_url_using_canonical_info_hash_if_needed ( & app_data, & info_hash) . await {
167
+ if let Some ( redirect_response) =
168
+ redirect_to_details_url_using_canonical_info_hash_if_needed ( & app_data, & info_hash, opt_user_id) . await
169
+ {
168
170
redirect_response
169
171
} else {
170
172
match app_data. torrent_service . get_torrent_info ( & info_hash, opt_user_id) . await {
@@ -177,12 +179,9 @@ pub async fn get_torrent_info_handler(
177
179
async fn redirect_to_details_url_using_canonical_info_hash_if_needed (
178
180
app_data : & Arc < AppData > ,
179
181
info_hash : & InfoHash ,
182
+ opt_user_id : Option < i64 > ,
180
183
) -> Option < Response > {
181
- match app_data
182
- . torrent_info_hash_repository
183
- . find_canonical_info_hash_for ( info_hash)
184
- . await
185
- {
184
+ match app_data. torrent_service . get_canonical_info_hash ( info_hash, opt_user_id) . await {
186
185
Ok ( Some ( canonical_info_hash) ) => {
187
186
if canonical_info_hash != * info_hash {
188
187
return Some (
You can’t perform that action at this time.
0 commit comments