Skip to content

Commit

Permalink
fix: some bible book names would not display in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
sircharlo committed Dec 9, 2024
1 parent d3c9ca4 commit 9664daa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/components/dialog/DialogAudioBible.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
:color="!book.files ? '' : 'accent-200'"
:disable="!book.files"
no-caps
:text-color="!book.files ? 'accent-300' : 'black'"
:text-color="!book.files ? 'accent-400' : 'black'"
unelevated
@click="selectedBibleBook = book.booknum || 0"
>
Expand Down
35 changes: 17 additions & 18 deletions src/helpers/jw-media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1032,32 +1032,31 @@ export const getAudioBibleMedia = async (force = false) => {
}

if (backupNameNeeded.length) {
const { nwtDb } = await getStudyBible();
const { nwtDb, nwtStyDb } = await getStudyBible();

if (nwtDb) {
const bibleBooksSimpleQuery = `
if (!(nwtStyDb || nwtDb)) return;

const bibleBooksSimpleQuery = `
SELECT *
FROM
Document
WHERE
Class = 1
`;

const bibleBookLocalNames =
window.electronApi.executeQuery<JwPlaylistItem>(
nwtDb,
bibleBooksSimpleQuery,
);
console.log('backupBooks', backupNameNeeded, bibleBookLocalNames);
for (const booknum of backupNameNeeded) {
const pubName = bibleBookLocalNames.find(
(item) => item.ChapterNumber === booknum,
)?.Title;
returnedItems[booknum - 1] = {
booknum,
pubName,
};
}
const bibleBookLocalNames =
window.electronApi.executeQuery<JwPlaylistItem>(
(nwtStyDb || nwtDb) as string,
bibleBooksSimpleQuery,
);
for (const booknum of backupNameNeeded) {
const pubName = bibleBookLocalNames.find(
(item) => item.ChapterNumber === booknum,
)?.Title;
returnedItems[booknum - 1] = {
booknum,
pubName,
};
}
}
jwStore.jwBibleAudioFiles[lang] = {
Expand Down

0 comments on commit 9664daa

Please sign in to comment.