Fix Transmission torrent fetch (#389)

This commit is contained in:
Flaminel
2025-12-19 23:35:23 +02:00
committed by GitHub
parent b16fa70774
commit c07b811cf8
2 changed files with 10 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ namespace Cleanuparr.Infrastructure.Features.DownloadClient.Transmission;
/// </summary>
public interface ITransmissionClientWrapper
{
Task<SessionInfo> GetSessionInformationAsync();
Task<SessionInfo?> GetSessionInformationAsync();
Task<TransmissionTorrents?> TorrentGetAsync(string[] fields, string? hash = null);
Task TorrentSetAsync(TorrentSettings settings);
Task TorrentSetLocationAsync(long[] ids, string location, bool move);

View File

@@ -16,11 +16,18 @@ public sealed class TransmissionClientWrapper : ITransmissionClientWrapper
_client = client;
}
public Task<SessionInfo> GetSessionInformationAsync()
public Task<SessionInfo?> GetSessionInformationAsync()
=> _client.GetSessionInformationAsync();
public Task<TransmissionTorrents?> TorrentGetAsync(string[] fields, string? hash = null)
=> _client.TorrentGetAsync(fields, hash);
{
if (hash is null)
{
return _client.TorrentGetAsync(fields);
}
return _client.TorrentGetAsync(fields, hash);
}
public Task TorrentSetAsync(TorrentSettings settings)
=> _client.TorrentSetAsync(settings);