mirror of
https://github.com/Radarr/Radarr
synced 2025-01-03 05:44:50 +00:00
Fixed: Indexer flags for torrent release pushes
(cherry picked from commit 47ba002806fe2c2004a649aa193ae318343a84e4)
This commit is contained in:
parent
1c52f0f5bd
commit
649702eaca
1 changed files with 7 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using NzbDrone.Core.DecisionEngine;
|
||||
using NzbDrone.Core.Indexers;
|
||||
|
@ -52,7 +53,7 @@ public class ReleaseResource : RestResource
|
|||
public int? Seeders { get; set; }
|
||||
public int? Leechers { get; set; }
|
||||
public DownloadProtocol Protocol { get; set; }
|
||||
public IEnumerable<string> IndexerFlags { get; set; }
|
||||
public dynamic IndexerFlags { get; set; }
|
||||
|
||||
// Sent when queuing an unknown release
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
|
@ -135,6 +136,11 @@ public static ReleaseInfo ToModel(this ReleaseResource resource)
|
|||
Seeders = resource.Seeders,
|
||||
Peers = (resource.Seeders.HasValue && resource.Leechers.HasValue) ? (resource.Seeders + resource.Leechers) : null
|
||||
};
|
||||
|
||||
if (resource.IndexerFlags is JsonElement { ValueKind: JsonValueKind.Number } indexerFlags)
|
||||
{
|
||||
model.IndexerFlags = (IndexerFlags)indexerFlags.GetInt32();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue