MagnetChoice: Add open in webtor button

WebTor is a website to view magnet links on the web for free. It
has an API to include magnets, so why not?

Suggested by BlackSwordsman in Discord.

Signed-off-by: kingbri <bdashore3@gmail.com>
This commit is contained in:
kingbri 2022-07-26 21:49:04 -04:00
parent b88a6cf96f
commit 467eb1eb09

View file

@ -74,6 +74,14 @@ struct MagnetChoiceView: View {
showActivityView.toggle()
}
}
Button("Open in WebTor") {
if let result = scrapingModel.selectedSearchResult,
let url = URL(string: "https://webtor.io/#/show?magnet=\(result.magnetLink)")
{
UIApplication.shared.open(url)
}
}
}
}
.activitySheet($activityItem)