mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
animetorrents: add current time of day if date added is today
This commit is contained in:
@@ -134,7 +134,9 @@ namespace Jackett.Common.Indexers
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (configData.DownloadableOnly.Value)
|
if (configData.DownloadableOnly.Value)
|
||||||
|
{
|
||||||
queryCollection.Set("dlable", "1");
|
queryCollection.Set("dlable", "1");
|
||||||
|
}
|
||||||
|
|
||||||
searchUrl += "?" + queryCollection.GetQueryString();
|
searchUrl += "?" + queryCollection.GetQueryString();
|
||||||
|
|
||||||
@@ -153,7 +155,7 @@ namespace Jackett.Common.Indexers
|
|||||||
var dom = parser.ParseDocument(results);
|
var dom = parser.ParseDocument(results);
|
||||||
|
|
||||||
var rows = dom.QuerySelectorAll("table tr");
|
var rows = dom.QuerySelectorAll("table tr");
|
||||||
foreach (var row in rows.Skip(1))
|
foreach (var (row, index) in rows.Skip(1).Select((v, i) => (v, i)))
|
||||||
{
|
{
|
||||||
var downloadVolumeFactor = row.QuerySelector("img[alt=\"Gold Torrent\"]") != null ? 0 : row.QuerySelector("img[alt=\"Silver Torrent\"]") != null ? 0.5 : 1;
|
var downloadVolumeFactor = row.QuerySelector("img[alt=\"Gold Torrent\"]") != null ? 0 : row.QuerySelector("img[alt=\"Silver Torrent\"]") != null ? 0.5 : 1;
|
||||||
|
|
||||||
@@ -185,6 +187,13 @@ namespace Jackett.Common.Indexers
|
|||||||
var categoryLink = row.QuerySelector("td:nth-of-type(1) a")?.GetAttribute("href") ?? string.Empty;
|
var categoryLink = row.QuerySelector("td:nth-of-type(1) a")?.GetAttribute("href") ?? string.Empty;
|
||||||
var categoryId = ParseUtil.GetArgumentFromQueryString(categoryLink, "cat");
|
var categoryId = ParseUtil.GetArgumentFromQueryString(categoryLink, "cat");
|
||||||
|
|
||||||
|
var publishedDate = DateTime.ParseExact(row.QuerySelector("td:nth-of-type(5)").TextContent, "dd MMM yy", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);
|
||||||
|
|
||||||
|
if (publishedDate.Date == DateTime.Today)
|
||||||
|
{
|
||||||
|
publishedDate = publishedDate.Date + DateTime.Now.TimeOfDay - TimeSpan.FromMinutes(index);
|
||||||
|
}
|
||||||
|
|
||||||
var release = new ReleaseInfo
|
var release = new ReleaseInfo
|
||||||
{
|
{
|
||||||
Guid = new Uri(infoUrl),
|
Guid = new Uri(infoUrl),
|
||||||
@@ -192,7 +201,7 @@ namespace Jackett.Common.Indexers
|
|||||||
Link = new Uri(downloadUrl),
|
Link = new Uri(downloadUrl),
|
||||||
Title = title,
|
Title = title,
|
||||||
Category = MapTrackerCatToNewznab(categoryId),
|
Category = MapTrackerCatToNewznab(categoryId),
|
||||||
PublishDate = DateTime.ParseExact(row.QuerySelector("td:nth-of-type(5)").TextContent, "dd MMM yy", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal),
|
PublishDate = publishedDate,
|
||||||
Size = ParseUtil.GetBytes(row.QuerySelector("td:nth-of-type(6)").TextContent.Trim()),
|
Size = ParseUtil.GetBytes(row.QuerySelector("td:nth-of-type(6)").TextContent.Trim()),
|
||||||
Seeders = seeders,
|
Seeders = seeders,
|
||||||
Peers = ParseUtil.CoerceInt(connections[1]) + seeders,
|
Peers = ParseUtil.CoerceInt(connections[1]) + seeders,
|
||||||
|
Reference in New Issue
Block a user