Skip to content

Commit

Permalink
switch back to const
Browse files Browse the repository at this point in the history
  • Loading branch information
elisabeth-sorrell committed Jan 8, 2025
1 parent 1bd3230 commit 1fb1b3c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Aquifer.Common/Services/BibleTextService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed class BibleTextService(AquiferDbContext dbContext, ICachingVersifi
{
public async Task<List<BibleText>> GetBibleTextsForBibleIdAsync(int toBibleId, int startVerseId, int endVerseId, CancellationToken ct)
{
var fromBibleId = 1;
const int fromBibleId = 1;
var skipMapping = toBibleId == fromBibleId;

var mappedStartVerseId = skipMapping
Expand All @@ -24,11 +24,11 @@ public async Task<List<BibleText>> GetBibleTextsForBibleIdAsync(int toBibleId, i
? endVerseId
: await VersificationUtilities.GetVersificationAsync(endVerseId, fromBibleId, toBibleId, versificationService, ct);

var (bookId, startChapter, startVerse) = BibleUtilities.TranslateVerseId(mappedStartVerseId);
var (_, endChapter, endVerse) = BibleUtilities.TranslateVerseId(mappedEndVerseId);
var (startBookId, startChapter, startVerse) = BibleUtilities.TranslateVerseId(mappedStartVerseId);
var (endBookId, endChapter, endVerse) = BibleUtilities.TranslateVerseId(mappedEndVerseId);

return await dbContext.BibleTexts
.Where(bt => bt.BibleId == toBibleId && bt.BookId == bookId &&
.Where(bt => bt.BibleId == toBibleId && bt.BookId == startBookId &&
bt.ChapterNumber >= startChapter && bt.ChapterNumber <= endChapter &&
(bt.ChapterNumber != startChapter || bt.VerseNumber >= startVerse) &&
(bt.ChapterNumber != endChapter || bt.VerseNumber <= endVerse))
Expand Down

0 comments on commit 1fb1b3c

Please sign in to comment.