mirror of
https://github.com/lantean-code/qbtmud.git
synced 2025-11-05 14:35:21 +00:00
Compare commits
2 Commits
feature/ap
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d373ec3f6f | ||
|
|
b72aae734a |
@@ -208,9 +208,14 @@ namespace Lantean.QBTMud.Services
|
||||
{
|
||||
foreach (var hash in mainData.TorrentsRemoved)
|
||||
{
|
||||
if (!torrentList.Torrents.TryGetValue(hash, out var torrent))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (torrentList.Torrents.Remove(hash))
|
||||
{
|
||||
RemoveTorrentFromStates(torrentList, hash);
|
||||
RemoveTorrentFromStates(torrentList, torrent, hash);
|
||||
dataChanged = true;
|
||||
filterChanged = true;
|
||||
}
|
||||
@@ -373,13 +378,8 @@ namespace Lantean.QBTMud.Services
|
||||
UpdateTrackerState(torrentList, updatedTorrent, hash, previousSnapshot.Tracker);
|
||||
}
|
||||
|
||||
private static void RemoveTorrentFromStates(MainData torrentList, string hash)
|
||||
private static void RemoveTorrentFromStates(MainData torrentList, Torrent torrent, string hash)
|
||||
{
|
||||
if (!torrentList.Torrents.TryGetValue(hash, out var torrent))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var snapshot = CreateSnapshot(torrent);
|
||||
|
||||
torrentList.TagState[FilterHelper.TAG_ALL].Remove(hash);
|
||||
|
||||
@@ -7,6 +7,11 @@ namespace Lantean.QBitTorrentClient.Converters
|
||||
{
|
||||
public override IReadOnlyList<string>? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
||||
{
|
||||
if (reader.TokenType == JsonTokenType.Null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (reader.TokenType != JsonTokenType.String)
|
||||
{
|
||||
throw new JsonException("Must be of type string.");
|
||||
|
||||
Reference in New Issue
Block a user