From 145cd74969290ae3af68dcb68b8da0af340fb92d Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 19 Feb 2024 02:50:16 +0200 Subject: [PATCH] Avoid saving Indexer Flags in Last RSS Release info --- .../Migration/236_clear_last_rss_releases_info.cs | 14 ++++++++++++++ .../Indexers/TorrentPotato/TorrentPotatoParser.cs | 1 - src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs | 6 ++++-- src/NzbDrone.Core/Parser/Model/TorrentInfo.cs | 1 - 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 src/NzbDrone.Core/Datastore/Migration/236_clear_last_rss_releases_info.cs diff --git a/src/NzbDrone.Core/Datastore/Migration/236_clear_last_rss_releases_info.cs b/src/NzbDrone.Core/Datastore/Migration/236_clear_last_rss_releases_info.cs new file mode 100644 index 000000000..6b1f4b74c --- /dev/null +++ b/src/NzbDrone.Core/Datastore/Migration/236_clear_last_rss_releases_info.cs @@ -0,0 +1,14 @@ +using FluentMigrator; +using NzbDrone.Core.Datastore.Migration.Framework; + +namespace NzbDrone.Core.Datastore.Migration +{ + [Migration(236)] + public class clear_last_rss_releases_info : NzbDroneMigrationBase + { + protected override void MainDbUpgrade() + { + Execute.Sql("UPDATE \"IndexerStatus\" SET \"LastRssSyncReleaseInfo\" = NULL"); + } + } +} diff --git a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs index 847a965d3..069a49902 100644 --- a/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs +++ b/src/NzbDrone.Core/Indexers/TorrentPotato/TorrentPotatoParser.cs @@ -41,7 +41,6 @@ namespace NzbDrone.Core.Indexers.TorrentPotato torrentInfo.PublishDate = torrent.publish_date.ToUniversalTime(); torrentInfo.Seeders = torrent.seeders; torrentInfo.Peers = torrent.leechers + torrent.seeders; - torrentInfo.Freeleech = torrent.freeleech; results.Add(torrentInfo); } diff --git a/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs b/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs index 7f2b536a9..788ce9a10 100644 --- a/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs +++ b/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Text; -using Newtonsoft.Json; +using System.Text.Json.Serialization; using NzbDrone.Core.Download.Pending; using NzbDrone.Core.Indexers; using NzbDrone.Core.Languages; @@ -35,9 +35,11 @@ namespace NzbDrone.Core.Parser.Model public string Codec { get; set; } public string Resolution { get; set; } - public IndexerFlags IndexerFlags { get; set; } public List Languages { get; set; } + [JsonIgnore] + public IndexerFlags IndexerFlags { get; set; } + // Used to track pending releases that are being reprocessed [JsonIgnore] public PendingReleaseReason? PendingReleaseReason { get; set; } diff --git a/src/NzbDrone.Core/Parser/Model/TorrentInfo.cs b/src/NzbDrone.Core/Parser/Model/TorrentInfo.cs index 9f76fc9ee..7a3909f37 100644 --- a/src/NzbDrone.Core/Parser/Model/TorrentInfo.cs +++ b/src/NzbDrone.Core/Parser/Model/TorrentInfo.cs @@ -8,7 +8,6 @@ namespace NzbDrone.Core.Parser.Model public string InfoHash { get; set; } public int? Seeders { get; set; } public int? Peers { get; set; } - public bool Freeleech { get; set; } public static int? GetSeeders(ReleaseInfo release) {