diff --git a/src/Jackett.Common/Definitions/anilibria.yml b/src/Jackett.Common/Definitions/anilibria.yml index 4e6acd98d..5586efd02 100644 --- a/src/Jackett.Common/Definitions/anilibria.yml +++ b/src/Jackett.Common/Definitions/anilibria.yml @@ -45,14 +45,14 @@ search: title_alternative: selector: ..names.alternative optional: true - _year: + year: selector: ..season.year _quality: selector: quality.string _series: selector: series.string title: - text: "{{ .Result.title_ru }} / {{ .Result.title_en }}{{ if .Result.title_alternative }} / {{ .Result.title_alternative }}{{ else }}{{ end }} [{{ .Result._quality }}] - {{ .Result._series }}" + text: "{{ .Result.title_ru }} / {{ .Result.title_en }}{{ if .Result.title_alternative }} / {{ .Result.title_alternative }}{{ else }}{{ end }} ({{ .Result.year }}) [{{ .Result._quality }}] - {{ .Result._series }}" _code: selector: ..code details: diff --git a/src/Jackett.Common/Definitions/byrutor.yml b/src/Jackett.Common/Definitions/byrutor.yml index 5069e42db..9fee7e93f 100644 --- a/src/Jackett.Common/Definitions/byrutor.yml +++ b/src/Jackett.Common/Definitions/byrutor.yml @@ -288,7 +288,7 @@ search: fields: category: text: 1 - _year: + year: selector: div.shor_subtitles span filters: - name: regexp @@ -297,7 +297,7 @@ search: selector: div.short_titles > a filters: - name: append - args: " [{{ .Result._year }}]" + args: " [{{ .Result.year }}]" details: selector: div.short_titles > a attribute: href diff --git a/src/Jackett.Common/Definitions/digitalcore.yml b/src/Jackett.Common/Definitions/digitalcore.yml index 011ce7d0d..c7190da1b 100644 --- a/src/Jackett.Common/Definitions/digitalcore.yml +++ b/src/Jackett.Common/Definitions/digitalcore.yml @@ -174,10 +174,10 @@ search: title_desc: optional: true selector: title - _year_desc: + year_desc: optional: true selector: year - _genres_desc: + genre_desc: optional: true selector: genres _tagline_desc: @@ -222,5 +222,5 @@ search: - name: regexp args: "(.+?), $" description: - text: "{{ if .Result.title_desc }}Title: {{ .Result.title_desc }}
{{ else }}{{ end }}{{ if .Result._year_desc }}Year: {{ .Result._year_desc }}
{{ else }}{{ end }}{{ if .Result._genres_desc }}Genres: {{ .Result._genres_desc }}
{{ else }}{{ end }}{{ if .Result._tagline_desc }}Tagline: {{ .Result._tagline_desc }}
{{ else }}{{ end }}{{ if .Result._cast_desc }}Cast: {{ .Result._cast_desc }}
{{ else }}{{ end }}{{ if .Result._rating_desc }}Rating: {{ .Result._rating_desc }}
{{ else }}{{ end }}{{ if .Result._tag_desc }}Tags: {{ .Result._tag_desc }}
{{ else }}{{ end }}{{ if .Result._predate_desc }}PRE: {{ .Result._predate_desc }}
{{ else }}{{ end }}{{ if .Result._section_desc }}Section: {{ .Result._section_desc }}{{ else }}{{ end }}" + text: "{{ if .Result.title_desc }}Title: {{ .Result.title_desc }}
{{ else }}{{ end }}{{ if .Result.year_desc }}Year: {{ .Result.year_desc }}
{{ else }}{{ end }}{{ if .Result.genre_desc }}Genres: {{ .Result.genre_desc }}
{{ else }}{{ end }}{{ if .Result._tagline_desc }}Tagline: {{ .Result._tagline_desc }}
{{ else }}{{ end }}{{ if .Result._cast_desc }}Cast: {{ .Result._cast_desc }}
{{ else }}{{ end }}{{ if .Result._rating_desc }}Rating: {{ .Result._rating_desc }}
{{ else }}{{ end }}{{ if .Result._tag_desc }}Tags: {{ .Result._tag_desc }}
{{ else }}{{ end }}{{ if .Result._predate_desc }}PRE: {{ .Result._predate_desc }}
{{ else }}{{ end }}{{ if .Result._section_desc }}Section: {{ .Result._section_desc }}{{ else }}{{ end }}" # json rartracker api v1 diff --git a/src/Jackett.Common/Definitions/haidan.yml b/src/Jackett.Common/Definitions/haidan.yml index ae3928a4a..799b24fee 100644 --- a/src/Jackett.Common/Definitions/haidan.yml +++ b/src/Jackett.Common/Definitions/haidan.yml @@ -112,7 +112,7 @@ search: filters: - name: querystring args: cat - _year: + year: optional: true selector: div.video_year filters: @@ -122,7 +122,7 @@ search: selector: a.video_name_str filters: - name: append - args: "{{ .Result._year }}" + args: "{{ .Result.year }}" details: selector: a.video_name_str attribute: href diff --git a/src/Jackett.Common/Definitions/hdtorrentsit.yml b/src/Jackett.Common/Definitions/hdtorrentsit.yml index 2ac5de90c..961f3a814 100644 --- a/src/Jackett.Common/Definitions/hdtorrentsit.yml +++ b/src/Jackett.Common/Definitions/hdtorrentsit.yml @@ -66,7 +66,7 @@ search: selector: tbody#highlighted tr fields: - _year: + year: selector: td:nth-child(2) a:nth-child(1) filters: - name: regexp # find torrent year @@ -108,7 +108,7 @@ search: - name: re_replace # remove various args: ["(?i)(Serie completa|Completa|\\[in pausa\\])", ""] - name: append - args: " ({{ .Result._year }}) [{{ .Result._quality }} - {{ .Result._audio }} ITA]" + args: " ({{ .Result.year }}) [{{ .Result._quality }} - {{ .Result._audio }} ITA]" - name: re_replace # replace multiple spaces args: ["[ ]{2,}", " "] details: diff --git a/src/Jackett.Common/Definitions/karagarga.yml b/src/Jackett.Common/Definitions/karagarga.yml index 5122bd9d0..06fe78c40 100644 --- a/src/Jackett.Common/Definitions/karagarga.yml +++ b/src/Jackett.Common/Definitions/karagarga.yml @@ -85,7 +85,7 @@ search: img[title^="Movie"]: 1 img[title^="Music"]: 2 img[title^="Literature"]: 3 - _year: + year: selector: a[href$="search_type=year"] optional: true _flag: @@ -104,7 +104,7 @@ search: selector: a[href^="details.php?id="] filters: - name: append - args: " {{ .Result._year }} {{ .Result._flag }} [{{ .Result._filename }}]" + args: " {{ .Result.year }} {{ .Result._flag }} [{{ .Result._filename }}]" details: selector: a[href^="details.php?id="] attribute: href diff --git a/src/Jackett.Common/Definitions/superbits.yml b/src/Jackett.Common/Definitions/superbits.yml index 8c260ac61..49dc30d25 100644 --- a/src/Jackett.Common/Definitions/superbits.yml +++ b/src/Jackett.Common/Definitions/superbits.yml @@ -175,10 +175,10 @@ search: title_desc: optional: true selector: title - _year_desc: + year_desc: optional: true selector: year - _genres_desc: + genre_desc: optional: true selector: genres _tagline_desc: @@ -263,5 +263,5 @@ search: - name: regexp args: "(.+?), $" description: - text: "{{ if .Result.title_desc }}Title: {{ .Result.title_desc }}
{{ else }}{{ end }}{{ if .Result._year_desc }}Year: {{ .Result._year_desc }}
{{ else }}{{ end }}{{ if .Result._genres_desc }}Genres: {{ .Result._genres_desc }}
{{ else }}{{ end }}{{ if .Result._tagline_desc }}Tagline: {{ .Result._tagline_desc }}
{{ else }}{{ end }}{{ if .Result._cast_desc }}Cast: {{ .Result._cast_desc }}
{{ else }}{{ end }}{{ if .Result._rating_desc }}Rating: {{ .Result._rating_desc }}
{{ else }}{{ end }}{{ if .Result._plot_desc }}Plot: {{ .Result._plot_desc }}
{{ else }}{{ end }}{{ if .Result._tag_desc }}Tags: {{ .Result._tag_desc }}
{{ else }}{{ end }}{{ if .Result._predate_desc }}PRE: {{ .Result._predate_desc }}
{{ else }}{{ end }}{{ if .Result._section_desc }}Section: {{ .Result._section_desc }}{{ else }}{{ end }}" + text: "{{ if .Result.title_desc }}Title: {{ .Result.title_desc }}
{{ else }}{{ end }}{{ if .Result.year_desc }}Year: {{ .Result.year_desc }}
{{ else }}{{ end }}{{ if .Result.genre_desc }}Genres: {{ .Result.genre_desc }}
{{ else }}{{ end }}{{ if .Result._tagline_desc }}Tagline: {{ .Result._tagline_desc }}
{{ else }}{{ end }}{{ if .Result._cast_desc }}Cast: {{ .Result._cast_desc }}
{{ else }}{{ end }}{{ if .Result._rating_desc }}Rating: {{ .Result._rating_desc }}
{{ else }}{{ end }}{{ if .Result._plot_desc }}Plot: {{ .Result._plot_desc }}
{{ else }}{{ end }}{{ if .Result._tag_desc }}Tags: {{ .Result._tag_desc }}
{{ else }}{{ end }}{{ if .Result._predate_desc }}PRE: {{ .Result._predate_desc }}
{{ else }}{{ end }}{{ if .Result._section_desc }}Section: {{ .Result._section_desc }}{{ else }}{{ end }}" # json rartracker api v1 diff --git a/src/Jackett.Common/Definitions/themixingbowl.yml b/src/Jackett.Common/Definitions/themixingbowl.yml index d16a47fba..3967e7609 100644 --- a/src/Jackett.Common/Definitions/themixingbowl.yml +++ b/src/Jackett.Common/Definitions/themixingbowl.yml @@ -104,7 +104,7 @@ search: attribute: href size: selector: td:nth-child(5) - _artist: + artist: selector: span.artist optional: true _tag: @@ -117,7 +117,7 @@ search: selector: td:nth-child(7) optional: true description: - text: "Artist=[{{ .Result._artist }}] , Tags={{ .Result._tag }} , Codec=[{{ .Result._codec }}] , BitRate=[{{ .Result._bit }}]" + text: "Artist=[{{ .Result.artist }}] , Tags={{ .Result._tag }} , Codec=[{{ .Result._codec }}] , BitRate=[{{ .Result._bit }}]" grabs: selector: td:nth-child(8) seeders: diff --git a/src/Jackett.Common/Definitions/torrentv.yml b/src/Jackett.Common/Definitions/torrentv.yml index f5a91ea85..4b153b014 100644 --- a/src/Jackett.Common/Definitions/torrentv.yml +++ b/src/Jackett.Common/Definitions/torrentv.yml @@ -56,12 +56,12 @@ search: attribute: src _subcat: selector: div.box ul li:first-child - _year: + year: selector: div.box ul li:contains("Year:") _quality: selector: div.box ul li:contains("Quality:") description: - text: "{{ .Result._subcat }} {{ .Result._year }} {{ .Result._quality }}" + text: "{{ .Result._subcat }} {{ .Result.year }} {{ .Result._quality }}" date: text: now size: diff --git a/src/Jackett.Common/Definitions/yts.yml b/src/Jackett.Common/Definitions/yts.yml index 00f8f0cc1..a16c3e586 100644 --- a/src/Jackett.Common/Definitions/yts.yml +++ b/src/Jackett.Common/Definitions/yts.yml @@ -84,7 +84,7 @@ search: "*": 45 _type: selector: type - _year: + year: selector: ..year title: selector: ..title @@ -95,7 +95,7 @@ search: args: [" ", "."] # append type: BRRip or WEBRip, resolves #3558 via #4577 - name: append - args: ".{{ .Result._year }}.{{ .Result._quality }}.{{ if eq .Result._type \"web\" }}WEBRip{{ else }}BRRip{{ end }}-YTS" + args: ".{{ .Result.year }}.{{ .Result._quality }}.{{ if eq .Result._type \"web\" }}WEBRip{{ else }}BRRip{{ end }}-YTS" _sitelink_trimmed: text: "{{ .Config.sitelink }}" filters: diff --git a/src/Jackett.Common/Indexers/CardigannIndexer.cs b/src/Jackett.Common/Indexers/CardigannIndexer.cs index 624f2ce5e..239f0adb0 100644 --- a/src/Jackett.Common/Indexers/CardigannIndexer.cs +++ b/src/Jackett.Common/Indexers/CardigannIndexer.cs @@ -38,7 +38,7 @@ namespace Jackett.Common.Indexers set => base.configData = value; } - protected readonly string[] OptionalFields = { "imdb", "imdbid", "rageid", "tmdbid", "tvdbid", "poster", "description", "doubanid" }; + protected readonly string[] OptionalFields = { "imdb", "imdbid", "tmdbid", "rageid", "tvdbid", "doubanid", "poster", "description" }; private static readonly string[] _SupportedLogicFunctions = { @@ -2043,13 +2043,6 @@ namespace Jackett.Common.Indexers release.TMDb = ParseUtil.CoerceLong(TmdbID); value = release.TMDb.ToString(); break; - case "doubanid": - var DoubanIDRegEx = new Regex(@"(\d+)", RegexOptions.Compiled); - var DoubanIDMatch = DoubanIDRegEx.Match(value); - var DoubanID = DoubanIDMatch.Groups[1].Value; - release.DoubanId = ParseUtil.CoerceLong(DoubanID); - value = release.DoubanId.ToString(); - break; case "rageid": var RageIDRegEx = new Regex(@"(\d+)", RegexOptions.Compiled); var RageIDMatch = RageIDRegEx.Match(value); @@ -2064,12 +2057,33 @@ namespace Jackett.Common.Indexers release.TVDBId = ParseUtil.CoerceLong(TVDBId); value = release.TVDBId.ToString(); break; + case "doubanid": + var DoubanIDRegEx = new Regex(@"(\d+)", RegexOptions.Compiled); + var DoubanIDMatch = DoubanIDRegEx.Match(value); + var DoubanID = DoubanIDMatch.Groups[1].Value; + release.DoubanId = ParseUtil.CoerceLong(DoubanID); + value = release.DoubanId.ToString(); + break; + case "genre": + release.Genres = release.Genres.Union(value.Split(',')).ToList(); + value = release.Genres.ToString(); + break; + case "year": + release.Year = ReleaseInfo.GetBytes(value); + value = release.Year.ToString(); + break; case "author": release.Author = value; break; case "booktitle": release.BookTitle = value; break; + case "artist": + release.Artist = value; + break; + case "album": + release.Album = value; + break; case "poster": if (!string.IsNullOrWhiteSpace(value)) { diff --git a/src/Jackett.Common/Models/ReleaseInfo.cs b/src/Jackett.Common/Models/ReleaseInfo.cs index 69ae23db3..c8a68e454 100644 --- a/src/Jackett.Common/Models/ReleaseInfo.cs +++ b/src/Jackett.Common/Models/ReleaseInfo.cs @@ -25,8 +25,12 @@ namespace Jackett.Common.Models public long? Imdb { get; set; } public long? TMDb { get; set; } public long? DoubanId { get; set; } + public ICollection Genres { get; set; } + public long? Year { get; set; } public string Author { get; set; } public string BookTitle { get; set; } + public string Artist { get; set; } + public string Album { get; set; } public long? Seeders { get; set; } public long? Peers { get; set; } public Uri Poster { get; set; } @@ -60,11 +64,16 @@ namespace Jackett.Common.Models Grabs = copyFrom.Grabs; Description = copyFrom.Description; RageID = copyFrom.RageID; + TVDBId = copyFrom.TVDBId; Imdb = copyFrom.Imdb; TMDb = copyFrom.TMDb; DoubanId = copyFrom.DoubanId; + Genres = copyFrom.Genres; + Year = copyFrom.Year; Author = copyFrom.Author; BookTitle = copyFrom.BookTitle; + Artist = copyFrom.Artist; + Album = copyFrom.Album; Seeders = copyFrom.Seeders; Peers = copyFrom.Peers; Poster = copyFrom.Poster; diff --git a/src/Jackett.Common/Models/ResultPage.cs b/src/Jackett.Common/Models/ResultPage.cs index cc53ced99..07e763b79 100644 --- a/src/Jackett.Common/Models/ResultPage.cs +++ b/src/Jackett.Common/Models/ResultPage.cs @@ -94,22 +94,27 @@ namespace Jackett.Common.Models new XAttribute("type", "application/x-bittorrent") ), r.Category == null ? null : from c in r.Category select GetTorznabElement("category", c), - GetTorznabElement("imdb", r.Imdb?.ToString("D7")), - GetTorznabElement("imdbid", r.Imdb != null ? "tt" + r.Imdb?.ToString("D7") : null), GetTorznabElement("rageid", r.RageID), GetTorznabElement("tvdbid", r.TVDBId), + GetTorznabElement("imdb", r.Imdb?.ToString("D7")), + GetTorznabElement("imdbid", r.Imdb != null ? "tt" + r.Imdb?.ToString("D7") : null), GetTorznabElement("tmdbid", r.TMDb), + GetTorznabElement("doubanid", r.DoubanId), + r.Genres == null ? null : GetTorznabElement("genre", string.Join(", ", r.Genres)), + GetTorznabElement("year", r.Year), GetTorznabElement("author", RemoveInvalidXMLChars(r.Author)), GetTorznabElement("booktitle", RemoveInvalidXMLChars(r.BookTitle)), + GetTorznabElement("artist", RemoveInvalidXMLChars(r.Artist)), + GetTorznabElement("album", RemoveInvalidXMLChars(r.Album)), GetTorznabElement("seeders", r.Seeders), GetTorznabElement("peers", r.Peers), - GetTorznabElement("magneturl", r.MagnetUri?.AbsoluteUri), + GetTorznabElement("coverurl", r.Poster?.AbsoluteUri), GetTorznabElement("infohash", RemoveInvalidXMLChars(r.InfoHash)), + GetTorznabElement("magneturl", r.MagnetUri?.AbsoluteUri), GetTorznabElement("minimumratio", r.MinimumRatio), GetTorznabElement("minimumseedtime", r.MinimumSeedTime), GetTorznabElement("downloadvolumefactor", r.DownloadVolumeFactor), - GetTorznabElement("uploadvolumefactor", r.UploadVolumeFactor), - GetTorznabElement("coverurl", r.Poster?.AbsoluteUri) + GetTorznabElement("uploadvolumefactor", r.UploadVolumeFactor) ) ) )