Fix deleting torrents from provider

This commit is contained in:
Sam Heinz 2024-08-31 10:17:27 +10:00
parent 183798db2d
commit e60059a5bd
2 changed files with 3 additions and 5 deletions

View file

@ -22,7 +22,7 @@
<PackageReference Include="Serilog" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="SharpCompress" Version="0.37.2" />
<PackageReference Include="TorBox.NET" Version="1.0.0.23" />
<PackageReference Include="TorBox.NET" Version="1.0.0.25" />
</ItemGroup>
<ItemGroup>

View file

@ -168,15 +168,13 @@ public class TorBoxTorrentClient(ILogger<TorBoxTorrentClient> logger, IHttpClien
public async Task Delete(String torrentId)
{
await GetClient().Torrents.ControlAsync(Convert.ToInt32(torrentId), "delete");
await GetClient().Torrents.ControlAsync(torrentId, "delete");
}
public async Task<String> Unrestrict(String link)
{
var torrentFile = new List<string>(link.Split('/'));
var torrentID = torrentFile[4];
var fileID = torrentFile[5];
var result = await GetClient().Unrestrict.LinkAsync(torrentID, fileID);
var result = await GetClient().Unrestrict.LinkAsync(torrentID: torrentFile[4], fileID: torrentFile[5]);
if (result.Error != null)
{