mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: (Cardigann) - Cardigann v4 Support for Genre, Year, and TraktID
This commit is contained in:
@@ -91,10 +91,12 @@ namespace NzbDrone.Core.IndexerSearch
|
|||||||
r.IndexerFlags == null ? null : from f in r.IndexerFlags select GetNabElement("tag", f.Name, protocol),
|
r.IndexerFlags == null ? null : from f in r.IndexerFlags select GetNabElement("tag", f.Name, protocol),
|
||||||
r.Languages == null ? null : from c in r.Languages select GetNabElement("language", c.Id, protocol),
|
r.Languages == null ? null : from c in r.Languages select GetNabElement("language", c.Id, protocol),
|
||||||
r.Subs == null ? null : from c in r.Subs select GetNabElement("subs", c.Id, protocol),
|
r.Subs == null ? null : from c in r.Subs select GetNabElement("subs", c.Id, protocol),
|
||||||
|
r.Genres == null ? null : GetNabElement("genre", string.Join(", ", r.Genres), protocol),
|
||||||
GetNabElement("rageid", r.TvRageId, protocol),
|
GetNabElement("rageid", r.TvRageId, protocol),
|
||||||
GetNabElement("tvdbid", r.TvdbId, protocol),
|
GetNabElement("tvdbid", r.TvdbId, protocol),
|
||||||
GetNabElement("imdb", r.ImdbId.ToString("D7"), protocol),
|
GetNabElement("imdb", r.ImdbId.ToString("D7"), protocol),
|
||||||
GetNabElement("tmdbid", r.TmdbId, protocol),
|
GetNabElement("tmdbid", r.TmdbId, protocol),
|
||||||
|
GetNabElement("traktid", r.TraktId, protocol),
|
||||||
GetNabElement("seeders", t.Seeders, protocol),
|
GetNabElement("seeders", t.Seeders, protocol),
|
||||||
GetNabElement("files", r.Files, protocol),
|
GetNabElement("files", r.Files, protocol),
|
||||||
GetNabElement("grabs", r.Grabs, protocol),
|
GetNabElement("grabs", r.Grabs, protocol),
|
||||||
|
@@ -28,7 +28,7 @@ namespace NzbDrone.Core.IndexerVersions
|
|||||||
/* Update Service will fall back if version # does not exist for an indexer per Ta */
|
/* Update Service will fall back if version # does not exist for an indexer per Ta */
|
||||||
|
|
||||||
private const string DEFINITION_BRANCH = "master";
|
private const string DEFINITION_BRANCH = "master";
|
||||||
private const int DEFINITION_VERSION = 3;
|
private const int DEFINITION_VERSION = 4;
|
||||||
|
|
||||||
//Used when moving yml to C#
|
//Used when moving yml to C#
|
||||||
private readonly List<string> _defintionBlocklist = new List<string>()
|
private readonly List<string> _defintionBlocklist = new List<string>()
|
||||||
|
@@ -561,6 +561,13 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
|||||||
release.TvRageId = (int)ParseUtil.CoerceLong(rageID);
|
release.TvRageId = (int)ParseUtil.CoerceLong(rageID);
|
||||||
value = release.TvRageId.ToString();
|
value = release.TvRageId.ToString();
|
||||||
break;
|
break;
|
||||||
|
case "traktid":
|
||||||
|
var traktIDRegEx = new Regex(@"(\d+)", RegexOptions.Compiled);
|
||||||
|
var traktIDMatch = traktIDRegEx.Match(value);
|
||||||
|
var traktID = traktIDMatch.Groups[1].Value;
|
||||||
|
release.TvRageId = (int)ParseUtil.CoerceLong(traktID);
|
||||||
|
value = release.TvRageId.ToString();
|
||||||
|
break;
|
||||||
case "tvdbid":
|
case "tvdbid":
|
||||||
var tvdbIdRegEx = new Regex(@"(\d+)", RegexOptions.Compiled);
|
var tvdbIdRegEx = new Regex(@"(\d+)", RegexOptions.Compiled);
|
||||||
var tvdbIdMatch = tvdbIdRegEx.Match(value);
|
var tvdbIdMatch = tvdbIdRegEx.Match(value);
|
||||||
@@ -577,6 +584,14 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
|||||||
|
|
||||||
value = release.PosterUrl;
|
value = release.PosterUrl;
|
||||||
break;
|
break;
|
||||||
|
case "genre":
|
||||||
|
release.Genres = release.Genres.Union(value.Split(',')).ToList();
|
||||||
|
value = release.Genres.ToString();
|
||||||
|
break;
|
||||||
|
case "year":
|
||||||
|
release.Year = ParseUtil.CoerceInt(value);
|
||||||
|
value = release.Year.ToString();
|
||||||
|
break;
|
||||||
case "author":
|
case "author":
|
||||||
release.Author = value;
|
release.Author = value;
|
||||||
break;
|
break;
|
||||||
|
@@ -32,6 +32,8 @@ namespace NzbDrone.Core.Parser.Model
|
|||||||
public int TvRageId { get; set; }
|
public int TvRageId { get; set; }
|
||||||
public int ImdbId { get; set; }
|
public int ImdbId { get; set; }
|
||||||
public int TmdbId { get; set; }
|
public int TmdbId { get; set; }
|
||||||
|
public int TraktId { get; set; }
|
||||||
|
public int Year { get; set; }
|
||||||
public string Author { get; set; }
|
public string Author { get; set; }
|
||||||
public string BookTitle { get; set; }
|
public string BookTitle { get; set; }
|
||||||
public string Artist { get; set; }
|
public string Artist { get; set; }
|
||||||
@@ -45,6 +47,7 @@ namespace NzbDrone.Core.Parser.Model
|
|||||||
public string Container { get; set; }
|
public string Container { get; set; }
|
||||||
public string Codec { get; set; }
|
public string Codec { get; set; }
|
||||||
public string Resolution { get; set; }
|
public string Resolution { get; set; }
|
||||||
|
public ICollection<string> Genres { get; set; }
|
||||||
public ICollection<Language> Languages { get; set; }
|
public ICollection<Language> Languages { get; set; }
|
||||||
public ICollection<Language> Subs { get; set; }
|
public ICollection<Language> Subs { get; set; }
|
||||||
public ICollection<IndexerCategory> Categories { get; set; }
|
public ICollection<IndexerCategory> Categories { get; set; }
|
||||||
|
Reference in New Issue
Block a user