Skip to content

Commit a4b14a7

Browse files
committed
refactor
1 parent a736c16 commit a4b14a7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hardcodesubv2.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ const ignorePixaVidIndex = []
8383
// hardcodetime/video duration ratio for each pixa video
8484
// const videoTimeRatio = [0.1751304347826087, 1.789804347826087, 0.5999347826086957, 0.34145652173913044, 0.1971304347826087, 0.22706521739130434, 0.21043478260869566, 0.17365217391304347, 0.1945, 0.22604347826086957, 0.2111086956521739, 0.773804347826087, 0.20578260869565218, 0.1725]
8585

86+
// Average hardcodetime/video duration ratio for pixa video
87+
const avgVideoRatio = 0.25
88+
8689
// Stores the beginning time
8790
const beginTime = new Date().getTime()
8891

@@ -356,7 +359,7 @@ async function generateMP4 (editionName, chap) {
356359

357360
// stop if uploaded files had reached the youtube upload limit or
358361
// remaining duration is not enought to hardcode the subtitles & upload
359-
if (remainingDuration < currChapDuration * 0.25) { return null }
362+
if (remainingDuration < currChapDuration * avgVideoRatio) { return null }
360363
console.log('selected pixabay video index is ', randomNo)
361364
// Pixabay Videos to use for recitation
362365
const pixaFileWithPath = path.join(pixabayPath, pixabayFiles[randomNo])

0 commit comments

Comments
 (0)