Skip to content

Commit

Permalink
Fixed the issue with displaying audio editor data
Browse files Browse the repository at this point in the history
  • Loading branch information
vipinpaul committed Nov 12, 2024
1 parent 05c449b commit e1b5446
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions renderer/src/components/EditorPage/AudioEditor/AudioEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ const AudioEditor = ({ editor }) => {
const _books = [];
Object.entries(_data.type.flavorType.currentScope).forEach(
async ([key]) => {
// Checking whether the selected book and chapter is in the scope or not
if (key === bookId.toUpperCase() && _data.type.flavorType.currentScope[key].includes(chapter)) {
// Checking whether the selected book and chapter is in the scope or not
if (key === bookId.toUpperCase() && _data.type.flavorType.currentScope[key].includes(chapter.toString())) {
_books.push(bookId.toUpperCase());
const fs = window.require('fs');
const path = require('path');
Expand Down Expand Up @@ -130,8 +130,8 @@ const AudioEditor = ({ editor }) => {
const arr = folder.match(re);
if (arr) {
const filePath = path.join(projectsDir, 'audio', 'ingredients', arr[0]);
if (!fs.existsSync(path.join(filePath, chapter))) {
fs.mkdirSync(path.join(filePath, chapter));
if (!fs.existsSync(path.join(filePath, chapter.toString()))) {
fs.mkdirSync(path.join(filePath, chapter.toString()));
}
const folderName = fs.readdirSync(filePath);
folderName.forEach((chapterNum) => {
Expand Down Expand Up @@ -178,7 +178,7 @@ const AudioEditor = ({ editor }) => {
if (arr || exists) {
Object.entries(bookContent).forEach(
([key]) => {
if (bookContent[key].chapterNumber === chapter) {
if (bookContent[key].chapterNumber === chapter.toString()) {
// Storing the content in the ReferenceContext for the MainPlayer component
setAudioContent(bookContent[key].contents);
}
Expand Down

0 comments on commit e1b5446

Please sign in to comment.