mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
tvstore: add genre results
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using AngleSharp.Html.Parser;
|
||||||
using Jackett.Common.Models;
|
using Jackett.Common.Models;
|
||||||
using Jackett.Common.Models.IndexerConfig.Bespoke;
|
using Jackett.Common.Models.IndexerConfig.Bespoke;
|
||||||
using Jackett.Common.Services.Interfaces;
|
using Jackett.Common.Services.Interfaces;
|
||||||
@@ -141,8 +142,8 @@ namespace Jackett.Common.Indexers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
/* Content Looks like this
|
/* Content Looks like this
|
||||||
* 2\15\2\1\1727\207244\1x08 \[WebDL-720p - Eng - AJP69]\gb\2018-03-09 08:11:53\akció, kaland, sci-fi \0\0\1\191170047\1\0\Anonymous\50\0\0\\0\4\0\174\0\
|
* 2\15\2\1\1727\207244\1x08 \[WebDL-720p - Eng - AJP69]\gb\2018-03-09 08:11:53\<a href='#m=4'><span class='mufaj'>dráma</span></a>, <a href='#m=13'><span class='mufaj'>romantika</span></a>, <a href='#m=20'><span class='mufaj'>orvosi</span></a> \0\0\1\191170047\1\0\Anonymous\50\0\0\\0\4\0\174\0\
|
||||||
* 1\ 0\0\1\1727\207243\1x08 \[WebDL-1080p - Eng - AJP69]\gb\2018-03-09 08:11:49\akció, kaland, sci-fi \0\0\1\305729738\1\0\Anonymous\50\0\0\\0\8\0\102\0\0\0\0\1\\\
|
* 1\ 0\0\1\1727\207243\1x08 \[WebDL-1080p - Eng - AJP69]\gb\2018-03-09 08:11:49\<a href='#m=4'><span class='mufaj'>dráma</span></a>, <a href='#m=13'><span class='mufaj'>romantika</span></a>, <a href='#m=20'><span class='mufaj'>orvosi</span></a> \0\0\1\305729738\1\0\Anonymous\50\0\0\\0\8\0\102\0\0\0\0\1\\\
|
||||||
* First 3 items per page are total results, results per page, and results this page
|
* First 3 items per page are total results, results per page, and results this page
|
||||||
* There is also a tail of ~4 items after the results for some reason. Looks like \1\\\
|
* There is also a tail of ~4 items after the results for some reason. Looks like \1\\\
|
||||||
*/
|
*/
|
||||||
@@ -159,6 +160,13 @@ namespace Jackett.Common.Indexers
|
|||||||
{
|
{
|
||||||
var torrentId = row[(int)TorrentParts.TorrentId];
|
var torrentId = row[(int)TorrentParts.TorrentId];
|
||||||
var downloadLink = new Uri(DownloadUrl + "?id=" + torrentId);
|
var downloadLink = new Uri(DownloadUrl + "?id=" + torrentId);
|
||||||
|
// the genre field is a html string, and we just want the text
|
||||||
|
var parser = new HtmlParser();
|
||||||
|
var dom = parser.ParseDocument(row[(int)TorrentParts.Genre]);
|
||||||
|
var genres = dom.QuerySelector("*").TextContent.Replace("\xA0", "");
|
||||||
|
var description = "";
|
||||||
|
if (!string.IsNullOrWhiteSpace(genres))
|
||||||
|
description = genres;
|
||||||
var imdbId = _imdbLookup.TryGetValue(int.Parse(row[(int)TorrentParts.InternalId]), out var imdb)
|
var imdbId = _imdbLookup.TryGetValue(int.Parse(row[(int)TorrentParts.InternalId]), out var imdb)
|
||||||
? (long?)imdb
|
? (long?)imdb
|
||||||
: null;
|
: null;
|
||||||
@@ -201,12 +209,16 @@ namespace Jackett.Common.Indexers
|
|||||||
Seeders = seeders,
|
Seeders = seeders,
|
||||||
Peers = leechers + seeders,
|
Peers = leechers + seeders,
|
||||||
Grabs = grabs,
|
Grabs = grabs,
|
||||||
|
Description = description,
|
||||||
MinimumRatio = 1,
|
MinimumRatio = 1,
|
||||||
MinimumSeedTime = 172800, // 48 hours
|
MinimumSeedTime = 172800, // 48 hours
|
||||||
DownloadVolumeFactor = 1,
|
DownloadVolumeFactor = 1,
|
||||||
UploadVolumeFactor = UploadFactorCalculator(publishDate, isSeasonPack),
|
UploadVolumeFactor = UploadFactorCalculator(publishDate, isSeasonPack),
|
||||||
Imdb = imdbId
|
Imdb = imdbId
|
||||||
};
|
};
|
||||||
|
if (release.Genres == null)
|
||||||
|
release.Genres = new List<string>();
|
||||||
|
release.Genres = release.Genres.Union(genres.Split(',')).ToList();
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -325,6 +337,7 @@ namespace Jackett.Common.Indexers
|
|||||||
TorrentId = 2,
|
TorrentId = 2,
|
||||||
EpisodeInfo = 3,
|
EpisodeInfo = 3,
|
||||||
PublishDate = 6,
|
PublishDate = 6,
|
||||||
|
Genre = 7,
|
||||||
Files = 10,
|
Files = 10,
|
||||||
SizeBytes = 11,
|
SizeBytes = 11,
|
||||||
Seeders = 20,
|
Seeders = 20,
|
||||||
|
Reference in New Issue
Block a user