mirror of
https://github.com/transmission/transmission
synced 2025-03-15 00:19:01 +00:00
feat: support redirects to magnet (#6012)
This commit is contained in:
parent
55da783e8f
commit
a7f93f4f15
1 changed files with 8 additions and 0 deletions
|
@ -1165,6 +1165,14 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
|
|||
return;
|
||||
}
|
||||
|
||||
NSString* urlString = task.currentRequest.URL.absoluteString;
|
||||
if ([urlString rangeOfString:@"magnet:" options:(NSAnchoredSearch | NSCaseInsensitiveSearch)].location != NSNotFound)
|
||||
{
|
||||
// originalRequest was a redirect to a magnet
|
||||
[self performSelectorOnMainThread:@selector(openMagnet:) withObject:urlString waitUntilDone:NO];
|
||||
return;
|
||||
}
|
||||
|
||||
NSString* message = [NSString
|
||||
stringWithFormat:NSLocalizedString(@"The torrent could not be downloaded from %@: %@.", "Torrent download failed -> message"),
|
||||
task.originalRequest.URL.absoluteString.stringByRemovingPercentEncoding,
|
||||
|
|
Loading…
Add table
Reference in a new issue