From 8c653b5c09f7cff707554238aea0d8e749cbd4a9 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 19 Feb 2024 01:56:51 +0200 Subject: [PATCH] Fixed: (GGn) Don't die on invalid FreeTorrent values in the API --- src/NzbDrone.Core/Indexers/Definitions/GazelleGames.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/GazelleGames.cs b/src/NzbDrone.Core/Indexers/Definitions/GazelleGames.cs index e012472bb69..d8573396592 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/GazelleGames.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/GazelleGames.cs @@ -412,6 +412,8 @@ public IList ParseResponse(IndexerResponse indexerResponse) categories = _categories.MapTrackerCatToNewznab(torrent.Value.CategoryId.ToString()).ToArray(); } + Enum.TryParse(torrent.Value.FreeTorrent, true, out GazelleGamesFreeTorrent freeTorrent); + var release = new TorrentInfo { Guid = infoUrl, @@ -426,8 +428,8 @@ public IList ParseResponse(IndexerResponse indexerResponse) Peers = torrent.Value.Leechers + torrent.Value.Seeders, PublishDate = torrent.Value.Time.ToUniversalTime(), Scene = torrent.Value.Scene == 1, - DownloadVolumeFactor = torrent.Value.FreeTorrent is GazelleGamesFreeTorrent.FreeLeech or GazelleGamesFreeTorrent.Neutral || torrent.Value.LowSeedFL ? 0 : 1, - UploadVolumeFactor = torrent.Value.FreeTorrent == GazelleGamesFreeTorrent.Neutral ? 0 : 1, + DownloadVolumeFactor = freeTorrent is GazelleGamesFreeTorrent.FreeLeech or GazelleGamesFreeTorrent.Neutral || torrent.Value.LowSeedFL ? 0 : 1, + UploadVolumeFactor = freeTorrent == GazelleGamesFreeTorrent.Neutral ? 0 : 1, MinimumSeedTime = 288000 // Minimum of 3 days and 8 hours (80 hours in total) }; @@ -588,7 +590,7 @@ public class GazelleGamesTorrent public int? Snatched { get; set; } public int Seeders { get; set; } public int Leechers { get; set; } - public GazelleGamesFreeTorrent FreeTorrent { get; set; } + public string FreeTorrent { get; set; } public bool PersonalFL { get; set; } public bool LowSeedFL { get; set; }