mirror of https://github.com/Jackett/Jackett
parent
9e3ecaee1f
commit
9b130c3e5a
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Jackett.Common.Models;
|
using Jackett.Common.Models;
|
||||||
|
@ -18,6 +19,7 @@ namespace Jackett.Common.Indexers
|
||||||
{
|
{
|
||||||
private string SearchUrl => SiteLink + "searchapi.php";
|
private string SearchUrl => SiteLink + "searchapi.php";
|
||||||
private string TorrentUrl => SiteLink + "torrents.php";
|
private string TorrentUrl => SiteLink + "torrents.php";
|
||||||
|
private readonly Regex _removeYearRegex = new Regex(@" [\(\[]?(19|20)\d{2}[\)\]]?$", RegexOptions.Compiled);
|
||||||
private new ConfigurationDataPasskey configData => (ConfigurationDataPasskey)base.configData;
|
private new ConfigurationDataPasskey configData => (ConfigurationDataPasskey)base.configData;
|
||||||
|
|
||||||
public AwesomeHD(IIndexerConfigurationService configService, Utils.Clients.WebClient c, Logger l, IProtectionService ps)
|
public AwesomeHD(IIndexerConfigurationService configService, Utils.Clients.WebClient c, Logger l, IProtectionService ps)
|
||||||
|
@ -75,10 +77,13 @@ namespace Jackett.Common.Indexers
|
||||||
}
|
}
|
||||||
else if (!string.IsNullOrWhiteSpace(query.GetQueryString()))
|
else if (!string.IsNullOrWhiteSpace(query.GetQueryString()))
|
||||||
{
|
{
|
||||||
var searchTerm = query.SearchTerm; // not use query.GetQueryString(), because it includes the season
|
// not use query.GetQueryString(), because it includes the season
|
||||||
if (query.Season > 0) // search for tv series
|
var searchTerm = query.SearchTerm;
|
||||||
|
// search for tv series
|
||||||
|
if (query.Season > 0)
|
||||||
searchTerm += $": Season {query.Season:D2}";
|
searchTerm += $": Season {query.Season:D2}";
|
||||||
|
// remove the year, it's not supported in the api
|
||||||
|
searchTerm = _removeYearRegex.Replace(searchTerm, "");
|
||||||
qc.Add("action", "titlesearch");
|
qc.Add("action", "titlesearch");
|
||||||
qc.Add("title", searchTerm);
|
qc.Add("title", searchTerm);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue