Skip to content

Commit

Permalink
Fix importer
Browse files Browse the repository at this point in the history
  • Loading branch information
i-vukman committed Sep 11, 2023
1 parent 9707342 commit 6388058
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ public async Task ImportAsync(int importPageRequestId)

var wikiDataCelebrities = await _httpClient.GetCelebritiesPageAsync(occupationId, nationalityId, limit, offset);

var celebrities = wikiDataCelebrities!.Results!.Bindings.Select(x => new Celebrity(x.ItemLabel.Value)
{
PhotoUrl = x.Image?.Value,
WikipediaUrl = x.WikipediaLink?.Value,
})
.DistinctBy(x => x.FullName.ToLower(new CultureInfo("en-US")))
.Where(x => !string.IsNullOrWhiteSpace(x.FullName.ToRemovedPunctuation().ToRemovedWhitespace()))
.ToList();
var celebrities = wikiDataCelebrities!.Results!.Bindings
.Where(x => !string.IsNullOrWhiteSpace(x.ItemLabel.Value.ToRemovedWhitespace().ToRemovedPunctuation()))
.Select(x => new Celebrity(x.ItemLabel.Value)
{
PhotoUrl = x.Image?.Value,
WikipediaUrl = x.WikipediaLink?.Value,
})
.DistinctBy(x => x.FullName.ToLower(new CultureInfo("en-US")))
.ToList();

var celebrityNames = celebrities.Select(x => x.FullName.ToLower(new CultureInfo("en-US"))).ToList();

Expand Down

0 comments on commit 6388058

Please sign in to comment.