We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f21f738 commit b8ce225Copy full SHA for b8ce225
code/Infrastructure/Verticals/DownloadClient/Deluge/DelugeClient.cs
@@ -80,11 +80,24 @@ public async Task<List<DelugeTorrentExtended>> ListTorrentsExtended(Dictionary<s
80
81
public async Task<TorrentStatus?> GetTorrentStatus(string hash)
82
{
83
- return await SendRequest<TorrentStatus?>(
84
- "web.get_torrent_status",
85
- hash,
86
- Fields
87
- );
+ try
+ {
+ return await SendRequest<TorrentStatus?>(
+ "web.get_torrent_status",
+ hash,
88
+ Fields
89
+ );
90
+ }
91
+ catch (DelugeClientException e)
92
93
+ // Deluge returns an error when the torrent is not found
94
+ if (e.Message == "AttributeError: 'NoneType' object has no attribute 'call'")
95
96
+ return null;
97
98
+
99
+ throw;
100
101
}
102
103
public async Task<List<TorrentStatus>?> GetStatusForAllTorrents()
0 commit comments