Update index.js

This commit is contained in:
Utkarsh Verma
2022-05-06 07:55:30 +05:30
parent 98aba240fd
commit 9463e197e3

View File

@@ -64,15 +64,15 @@ module.exports = async options => {
if (!isTimestamp(options.endTime)) { options.endTime = video.duration } if (!isTimestamp(options.endTime)) { options.endTime = video.duration }
// Float values
options.startTime = +options.startTime
options.endTime = +options.endTime
if (options.startTime >= options.endTime) { if (options.startTime >= options.endTime) {
options.startTime = options.endTime options.startTime = options.endTime
options.count = 1 options.count = 1
} }
// Float values
options.startTime = +options.startTime
options.endTime = +options.endTime
// Convert count value to a positive integer (floor() or 0 if string) // Convert count value to a positive integer (floor() or 0 if string)
options.count = Math.abs(~~options.count) options.count = Math.abs(~~options.count)
if (options.count === 0) { options.count = 1 } if (options.count === 0) { options.count = 1 }