Skip to content

Commit

Permalink
fixed chapter time for public episodes
Browse files Browse the repository at this point in the history
  • Loading branch information
VovaStelmashchuk committed Aug 18, 2024
1 parent fa5bce8 commit afb022d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const init = async () => {
};

process.on('unhandledRejection', (err) => {
console.log(err);
console.info(err);
process.exit(1);
});

Expand Down
1 change: 0 additions & 1 deletion src/core/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ client.connect()

export const Database = client.db('story-podcast-app')


2 changes: 1 addition & 1 deletion src/core/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function buildPublicChapters(chapters) {
adjustedChapters.push({
time: new Date(adjustedTimeInSeconds * 1000).toISOString().substr(11, 8),
description: chapter.description,
timeInSeconds: chapter.timeInSeconds,
timeInSeconds: chapter.timeInSeconds - totalPrivateChaptersTime,
});
} else {
const nextChapterTime = chapters[index + 1]?.time.split(':').reduce((acc, time) => (60 * acc) + +time, 0);
Expand Down

0 comments on commit afb022d

Please sign in to comment.