From afb022d799577b450fa22b6ccd936f95e0511d5c Mon Sep 17 00:00:00 2001 From: Vova Stelmashchuk Date: Sun, 18 Aug 2024 18:31:06 +0000 Subject: [PATCH] fixed chapter time for public episodes --- src/app.js | 2 +- src/core/client.js | 1 - src/core/generator.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app.js b/src/app.js index 0ce997a..73baf28 100644 --- a/src/app.js +++ b/src/app.js @@ -55,7 +55,7 @@ const init = async () => { }; process.on('unhandledRejection', (err) => { - console.log(err); + console.info(err); process.exit(1); }); diff --git a/src/core/client.js b/src/core/client.js index a9fe6e0..4cd798b 100644 --- a/src/core/client.js +++ b/src/core/client.js @@ -16,4 +16,3 @@ client.connect() export const Database = client.db('story-podcast-app') - diff --git a/src/core/generator.js b/src/core/generator.js index 60660d3..4ba931d 100644 --- a/src/core/generator.js +++ b/src/core/generator.js @@ -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);