mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
torrentnetworks: add genre query and results
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Jackett.Common.Models;
|
using Jackett.Common.Models;
|
||||||
@@ -43,19 +44,19 @@ namespace Jackett.Common.Indexers
|
|||||||
{
|
{
|
||||||
TvSearchParams = new List<TvSearchParam>
|
TvSearchParams = new List<TvSearchParam>
|
||||||
{
|
{
|
||||||
TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep
|
TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep, TvSearchParam.Genre
|
||||||
},
|
},
|
||||||
MovieSearchParams = new List<MovieSearchParam>
|
MovieSearchParams = new List<MovieSearchParam>
|
||||||
{
|
{
|
||||||
MovieSearchParam.Q
|
MovieSearchParam.Q, MovieSearchParam.Genre
|
||||||
},
|
},
|
||||||
MusicSearchParams = new List<MusicSearchParam>
|
MusicSearchParams = new List<MusicSearchParam>
|
||||||
{
|
{
|
||||||
MusicSearchParam.Q
|
MusicSearchParam.Q, MusicSearchParam.Genre
|
||||||
},
|
},
|
||||||
BookSearchParams = new List<BookSearchParam>
|
BookSearchParams = new List<BookSearchParam>
|
||||||
{
|
{
|
||||||
BookSearchParam.Q
|
BookSearchParam.Q, BookSearchParam.Genre
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
configService: configService,
|
configService: configService,
|
||||||
@@ -200,6 +201,9 @@ namespace Jackett.Common.Indexers
|
|||||||
{ "length", "100" }
|
{ "length", "100" }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (query.IsGenreQuery)
|
||||||
|
queryCollection.Add("genre", query.Genre);
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(searchString))
|
if (!string.IsNullOrWhiteSpace(searchString))
|
||||||
queryCollection.Add("search", searchString);
|
queryCollection.Add("search", searchString);
|
||||||
|
|
||||||
@@ -231,9 +235,10 @@ namespace Jackett.Common.Indexers
|
|||||||
//var preDelaySeconds = (long)torrent[4];
|
//var preDelaySeconds = (long)torrent[4];
|
||||||
var seeders = (int)torrent[6];
|
var seeders = (int)torrent[6];
|
||||||
//var imdbRating = (double)torrent[8] / 10;
|
//var imdbRating = (double)torrent[8] / 10;
|
||||||
var genres = (string)torrent[9];
|
var genres = torrent[9].ToString().Trim(',');
|
||||||
|
var description = "";
|
||||||
if (!string.IsNullOrWhiteSpace(genres))
|
if (!string.IsNullOrWhiteSpace(genres))
|
||||||
genres = "Genres: " + genres;
|
description = "Genres: " + genres;
|
||||||
// 12/13/14 unknown, probably IDs/name of the uploader
|
// 12/13/14 unknown, probably IDs/name of the uploader
|
||||||
//var row12 = (long)torrent[12];
|
//var row12 = (long)torrent[12];
|
||||||
//var row13 = (string)torrent[13];
|
//var row13 = (string)torrent[13];
|
||||||
@@ -262,11 +267,14 @@ namespace Jackett.Common.Indexers
|
|||||||
Size = (long)torrent[5],
|
Size = (long)torrent[5],
|
||||||
Seeders = seeders,
|
Seeders = seeders,
|
||||||
Peers = seeders + (int)torrent[7],
|
Peers = seeders + (int)torrent[7],
|
||||||
Description = genres,
|
Description = description,
|
||||||
UploadVolumeFactor = 1,
|
UploadVolumeFactor = 1,
|
||||||
DownloadVolumeFactor = downloadVolumeFactor,
|
DownloadVolumeFactor = downloadVolumeFactor,
|
||||||
Grabs = (long)torrent[11]
|
Grabs = (long)torrent[11]
|
||||||
};
|
};
|
||||||
|
if (release.Genres == null)
|
||||||
|
release.Genres = new List<string>();
|
||||||
|
release.Genres = release.Genres.Union(genres.Split(',')).ToList();
|
||||||
releases.Add(release);
|
releases.Add(release);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user