mirror of
https://github.com/Jackett/Jackett
synced 2025-01-01 04:38:20 +00:00
bjshare: Fix web format and series naming on 24h search (#8502)
This commit is contained in:
parent
6f5b9e098d
commit
c72ad70b66
1 changed files with 46 additions and 10 deletions
|
@ -164,6 +164,36 @@ namespace Jackett.Common.Indexers
|
|||
return false;
|
||||
}
|
||||
|
||||
private string FixYearPosition(string title, string year)
|
||||
{
|
||||
int index = title.LastIndexOf('-');
|
||||
// If its a series
|
||||
if (index != -1)
|
||||
{
|
||||
title = title.Substring(0, index) + year + " " + title.Substring(index + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
title += " " + year;
|
||||
}
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
private string FixNovelNumber(string title)
|
||||
{
|
||||
|
||||
if (title.Contains("[Novela]"))
|
||||
{
|
||||
title = Regex.Replace(title, @"(Cap[\.]?[ ]?)", "S01E");
|
||||
title = Regex.Replace(title, @"(\[Novela\]\ )", "");
|
||||
title = Regex.Replace(title, @"(\ \-\s*Completo)", " - S01");
|
||||
return title;
|
||||
}
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
private string FixAbsoluteNumbering(string title)
|
||||
{
|
||||
// if result is absolute numbered, convert title from SXXEXX to EXX
|
||||
|
@ -183,14 +213,6 @@ namespace Jackett.Common.Indexers
|
|||
return title;
|
||||
}
|
||||
|
||||
if (title.Contains("[Novela]"))
|
||||
{
|
||||
title = Regex.Replace(title, @"(Cap[\.]?[ ]?)", "S01E");
|
||||
title = Regex.Replace(title, @"(\[Novela\]\ )", "");
|
||||
title = Regex.Replace(title, @"(\ \-\s*Completo)", " - S01");
|
||||
return title;
|
||||
}
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
|
@ -296,6 +318,7 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
|
||||
release.Description = release.Description.Replace(" / Free", ""); // Remove Free Tag
|
||||
release.Description = release.Description.Replace("/ WEB ", "/ WEB-DL "); // Fix web/web-dl
|
||||
release.Description = release.Description.Replace("Full HD", "1080p");
|
||||
// Handles HDR conflict
|
||||
release.Description = release.Description.Replace("/ HD /", "/ 720p /");
|
||||
|
@ -398,6 +421,7 @@ namespace Jackett.Common.Indexers
|
|||
var year = "";
|
||||
release.Description = "";
|
||||
var extraInfo = "";
|
||||
var releaseQuality = "";
|
||||
foreach (var child in qBJinfoBox.ChildNodes)
|
||||
{
|
||||
var type = child.NodeType;
|
||||
|
@ -419,7 +443,16 @@ namespace Jackett.Common.Indexers
|
|||
release.PublishDate = publishDate.ToLocalTime();
|
||||
}
|
||||
else if (line.StartsWith("Ano:"))
|
||||
{
|
||||
year = line.Substring("Ano: ".Length);
|
||||
}
|
||||
else if (line.StartsWith("Qualidade:"))
|
||||
{
|
||||
releaseQuality = line.Substring("Qualidade: ".Length);
|
||||
if (releaseQuality == "WEB")
|
||||
releaseQuality = "WEB-DL";
|
||||
extraInfo += releaseQuality + " ";
|
||||
}
|
||||
else
|
||||
{
|
||||
release.Description += line + "\n";
|
||||
|
@ -436,9 +469,12 @@ namespace Jackett.Common.Indexers
|
|||
}
|
||||
|
||||
var catStr = qCatLink.GetAttribute("href").Split('=')[1].Split('&')[0];
|
||||
release.Title = FixAbsoluteNumbering(release.Title);
|
||||
if (!string.IsNullOrEmpty(year))
|
||||
release.Title += " " + year;
|
||||
release.Title = FixYearPosition(release.Title, year);
|
||||
|
||||
release.Title = FixAbsoluteNumbering(release.Title);
|
||||
release.Title = FixNovelNumber(release.Title);
|
||||
|
||||
if (qQuality != null)
|
||||
{
|
||||
var quality = qQuality.TextContent;
|
||||
|
|
Loading…
Reference in a new issue