Simplification of parsing in consumer

should speed up massively especially if imdbIds are found from mongodb
This commit is contained in:
iPromKnight
2024-03-11 10:56:04 +00:00
parent e23ee974e2
commit aeb83c19f8
5 changed files with 114 additions and 553 deletions

View File

@@ -15,7 +15,6 @@ public class NyaaCrawler(IHttpClientFactory httpClientFactory, ILogger<NyaaCrawl
[nameof(Torrent.Seeders)] = "seeders",
[nameof(Torrent.Leechers)] = "leechers",
[nameof(Torrent.InfoHash)] = "infoHash",
[nameof(Torrent.Category)] = "category",
};
protected override Torrent ParseTorrent(XElement itemNode) =>
@@ -27,6 +26,6 @@ public class NyaaCrawler(IHttpClientFactory httpClientFactory, ILogger<NyaaCrawl
Seeders = int.Parse(itemNode.Element(XmlNamespace + Mappings[nameof(Torrent.Seeders)])?.Value ?? "0"),
Leechers = int.Parse(itemNode.Element(XmlNamespace + Mappings[nameof(Torrent.Leechers)])?.Value ?? "0"),
InfoHash = itemNode.Element(XmlNamespace + Mappings[nameof(Torrent.InfoHash)])?.Value,
Category = itemNode.Element(XmlNamespace + Mappings[nameof(Torrent.Category)])?.Value.ToLowerInvariant(),
Category = "anime",
};
}