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
1 changed files with 2 additions and 2 deletions

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
};
}