speedapptracker: (speedapp, retroflix) add genre results

This commit is contained in:
Garfield69 2022-08-05 19:04:40 +12:00
parent 94d839bc8c
commit 4615f2d89b
1 changed files with 11 additions and 2 deletions

View File

@ -126,8 +126,14 @@ namespace Jackett.Common.Indexers.Abstract
var publishDate = DateTime.Parse(row.Value<string>("created_at"), CultureInfo.InvariantCulture);
var cat = row.Value<JToken>("category").Value<string>("id");
// "description" field in API has too much HTML code
var description = row.Value<string>("short_description");
var description = "";
var genres = row.Value<string>("short_description");
char[] delimiters = { ',', ' ', '/', ')', '(', '.', ';', '[', ']', '"', '|', ':' };
var genresSplit = genres.Split(delimiters, System.StringSplitOptions.RemoveEmptyEntries);
var genresList = genresSplit.ToList();
genres = string.Join(", ", genresList);
if (!string.IsNullOrEmpty(genres))
description = genres;
var posterStr = row.Value<string>("poster");
var poster = Uri.TryCreate(posterStr, UriKind.Absolute, out var posterUri) ? posterUri : null;
@ -162,6 +168,9 @@ namespace Jackett.Common.Indexers.Abstract
MinimumRatio = 1,
MinimumSeedTime = 172800 // 48 hours
};
if (release.Genres == null)
release.Genres = new List<string>();
release.Genres = release.Genres.Union(genres.Split(',')).ToList();
releases.Add(release);
}