1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2024-12-29 11:17:22 +00:00

corsarored: fix null category (#8471)

This commit is contained in:
Diego Heras 2020-05-01 18:56:27 +02:00 committed by GitHub
parent cb24d1aea7
commit 86374ab87e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -225,7 +225,7 @@ namespace Jackett.Common.Indexers
var publishDate = torrent["last_updated"] != null
? DateTime.Parse((string)torrent["last_updated"])
: DateTime.Now;
var cat = (int)torrent["category"];
var cat = (string)torrent["category"] ?? "25"; // if category is null set "25 / Other" category
var size = torrent["size"]?.ToObject<long>();
return new ReleaseInfo
{
@ -243,7 +243,7 @@ namespace Jackett.Common.Indexers
Guid = comments,
Peers = seeders + (int)torrent["leechers"],
PublishDate = publishDate,
Category = MapTrackerCatToNewznab(cat.ToString()),
Category = MapTrackerCatToNewznab(cat),
Size = size
};
}