Skip to content

Commit

Permalink
translate mappedVerseId to a startChapter/Verse/bookNumber format bef…
Browse files Browse the repository at this point in the history
…ore getting the BibleText
  • Loading branch information
elisabeth-sorrell committed Dec 16, 2024
1 parent ac79802 commit 7f924a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Aquifer.Common/Utilities/BibleTextUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ public static async Task<IEnumerable<Chapter>> GetTextsByBibleId(int bookNumber,
var verseId = BibleUtilities.GetVerseId(bookNumber, chapter, verse);

var mappedVerseId = await cachingService.GetVersificationMapping(bibleId, verseId, ct);
var (mappedBookNumber, mappedChapter, mappedVerse) = BibleUtilities.TranslateVerseId(mappedVerseId);

return await dbContext.BibleTexts
.Where(bt => bt.VerseNumber == mappedVerseId && bt.ChapterNumber == chapter && bt.BibleId == bibleId).Select(b => new Chapter
var bibleTexts = await dbContext.BibleTexts
.Where(bt => bt.VerseNumber == mappedVerse && bt.ChapterNumber == mappedChapter && bt.BookId == mappedBookNumber &&
bt.BibleId == bibleId).Select(b => new Chapter
{
Number = b.ChapterNumber,
Verse = new ChapterVerse
Expand All @@ -23,6 +25,7 @@ public static async Task<IEnumerable<Chapter>> GetTextsByBibleId(int bookNumber,
Text = b.Text
}
}).ToListAsync(ct);
return bibleTexts;
}
}

Expand Down

0 comments on commit 7f924a6

Please sign in to comment.