From 33c68e7964c52ba217a82438d0239a6e064a94b6 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 15 Jun 2023 09:30:40 +0300 Subject: [PATCH] New: (Cardigann) Add season/episode fields --- src/NzbDrone.Core/IndexerSearch/NewznabResults.cs | 2 ++ .../Indexers/Definitions/Cardigann/CardigannParser.cs | 8 ++++++++ src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/NzbDrone.Core/IndexerSearch/NewznabResults.cs b/src/NzbDrone.Core/IndexerSearch/NewznabResults.cs index 9943d3d82..75f354361 100644 --- a/src/NzbDrone.Core/IndexerSearch/NewznabResults.cs +++ b/src/NzbDrone.Core/IndexerSearch/NewznabResults.cs @@ -104,6 +104,8 @@ namespace NzbDrone.Core.IndexerSearch GetNabElement("files", r.Files, protocol), GetNabElement("grabs", r.Grabs, protocol), GetNabElement("peers", t.Peers, protocol), + GetNabElement("season", t.Season, protocol), + GetNabElement("episode", RemoveInvalidXMLChars(r.Episode), protocol), GetNabElement("author", RemoveInvalidXMLChars(r.Author), protocol), GetNabElement("booktitle", RemoveInvalidXMLChars(r.BookTitle), protocol), GetNabElement("artist", RemoveInvalidXMLChars(r.Artist), protocol), diff --git a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannParser.cs b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannParser.cs index cf8fc3b67..581f76d1d 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannParser.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/Cardigann/CardigannParser.cs @@ -644,6 +644,14 @@ namespace NzbDrone.Core.Indexers.Definitions.Cardigann release.Year = ParseUtil.CoerceInt(value); value = release.Year.ToString(); break; + case "season": + release.Season = ParseUtil.CoerceInt(value); + value = release.Season.ToString(); + break; + case "episode": + release.Episode = value; + value = release.Episode; + break; case "author": release.Author = value; break; diff --git a/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs b/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs index 22827f43c..aecbc525f 100644 --- a/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs +++ b/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs @@ -36,6 +36,8 @@ namespace NzbDrone.Core.Parser.Model public int TvMazeId { get; set; } public int DoubanId { get; set; } public int Year { get; set; } + public int? Season { get; set; } + public string Episode { get; set; } public string Author { get; set; } public string BookTitle { get; set; } public string Publisher { get; set; }