docs: fix for TOC generation appsettings.json : local

This commit is contained in:
Hamid Reza Mohammadi 2022-06-16 19:52:12 +04:30
parent 96406b3777
commit 4558de6d7d
2 changed files with 13 additions and 2 deletions

View File

@ -8,8 +8,8 @@
},
"AllowedHosts": "*",
"GoogleAnalyticsCode": "",
"APIRoot": "https://api.ganjoor.net",
"GlobalAPIRoot": "https://api.ganjoor.net",
"APIRoot": "http://localhost:3439",
"GlobalAPIRoot": "http://localhost:3439",
"SiteUrl": "http://localhost:33081",
"MockSpotify": "False",
"Spotify": {

View File

@ -348,6 +348,17 @@ namespace RMuseum.Services.Implementation
html += $"</div>{Environment.NewLine}";
}
var poemIds = poems.Select(p => p.Id).ToArray();
var mainPoemSections = await context.GanjoorPoemSections.Where(s => poemIds.Contains(s.PoemId) && s.SectionType == PoemSectionType.WholePoem && s.VerseType == VersePoemSectionType.First).ToListAsync();
foreach (var poem in poems)
{
var section = mainPoemSections.Where(s => s.PoemId == poem.Id).FirstOrDefault();
if (section != null)
poem.RhymeLetters = section.RhymeLetters;
}
if (poems.Count > 0)
{
if (options == GanjoorTOC.Analyse)