Comparing version 1.6.8 to 1.7.1
@@ -84,3 +84,3 @@ "use strict"; | ||
const { videoClipDuration: maxClipDuration = 5 } = config; | ||
let validVideoItems = []; | ||
let materialVideos = []; | ||
for (const [index, searchTerm] of searchTerms.entries()) { | ||
@@ -103,11 +103,10 @@ let videoItems = []; | ||
if (videoItems.length > 0) { | ||
const randomItem = (0, lodash_1.sample)(videoItems); | ||
validVideoItems.push(randomItem); | ||
const [a, b, c] = (0, utils_3.getSampleItems)(videoItems, 3); | ||
materialVideos = (0, utils_3.insertTriplet)(materialVideos, a, b, c); | ||
} | ||
} | ||
validVideoItems = validVideoItems.concat(validVideoItems); | ||
const videoPaths = []; | ||
let totalDuration = 0.0; | ||
let index = 0; | ||
for (const item of validVideoItems) { | ||
for (const item of materialVideos) { | ||
try { | ||
@@ -122,3 +121,3 @@ index++; | ||
} | ||
progress(40 + Math.floor((index * 45) / validVideoItems.length)); | ||
progress(40 + Math.floor((index * 45) / materialVideos.length)); | ||
if (savedVideoPath) { | ||
@@ -125,0 +124,0 @@ videoPaths.push(savedVideoPath); |
@@ -44,3 +44,3 @@ "use strict"; | ||
} | ||
const subtitle = (0, date_1.formatter)(scriptLinesIndex, startTime, endTime, lineText); | ||
const subtitle = (0, date_1.subtitleFormatter)(scriptLinesIndex, startTime, endTime, lineText); | ||
formattedSubtitles.push(subtitle); | ||
@@ -47,0 +47,0 @@ startTime = -1.0; |
@@ -28,3 +28,3 @@ "use strict"; | ||
`.trim(); | ||
const response = await (0, llm_1.callAIInterface)(prompt, config); | ||
let response = await (0, llm_1.callAIInterface)(prompt, config); | ||
const searchTerms = []; | ||
@@ -40,2 +40,3 @@ try { | ||
catch (error) { | ||
response = response || ''; | ||
const match = response.match(/\["(?:[^"\\]|\\.)*"(?:,\s*"[^"\\]*")*\]/); | ||
@@ -42,0 +43,0 @@ if (match) { |
declare const mktimestamp: (time_unit: number) => string; | ||
declare const formatter: (timeid: number, startTime: number, endTime: number, subText: string) => string; | ||
export { mktimestamp, formatter }; | ||
declare const subtitleFormatter: (timeid: number, startTime: number, endTime: number, subText: string) => string; | ||
export { mktimestamp, subtitleFormatter }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatter = exports.mktimestamp = void 0; | ||
exports.subtitleFormatter = exports.mktimestamp = void 0; | ||
const mktimestamp = (time_unit) => { | ||
@@ -11,8 +11,9 @@ const hour = Math.floor(time_unit / 10 ** 7 / 3600); | ||
exports.mktimestamp = mktimestamp; | ||
const formatter = (timeid, startTime, endTime, subText) => { | ||
const subtitleFormatter = (timeid, startTime, endTime, subText) => { | ||
const startT = mktimestamp(startTime).replace('.', ','); | ||
const endT = mktimestamp(endTime).replace('.', ','); | ||
return `${timeid}\n${startT} --> ${endT}\n${subText}\n`; | ||
const removeSpecialCharacters = subText.replace(/[,。!?,.!?…]$/, ''); | ||
return `${timeid}\n${startT} --> ${endT}\n${removeSpecialCharacters}\n`; | ||
}; | ||
exports.formatter = formatter; | ||
exports.subtitleFormatter = subtitleFormatter; | ||
//# sourceMappingURL=date.js.map |
@@ -8,2 +8,4 @@ declare const strContainsPunctuation: (word: string) => boolean; | ||
declare const convertHexToAssColor: (hexColor: string) => string; | ||
export { uuid, appequal, getEnumKeyByValue, strContainsPunctuation, convertHexToAssColor, }; | ||
declare const insertTriplet: (arr: any[], a: any, b: any, c: any) => any[]; | ||
declare const getSampleItems: (items: any[], count: number) => any[]; | ||
export { uuid, appequal, insertTriplet, getSampleItems, getEnumKeyByValue, strContainsPunctuation, convertHexToAssColor, }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.convertHexToAssColor = exports.strContainsPunctuation = exports.getEnumKeyByValue = exports.appequal = exports.uuid = void 0; | ||
exports.convertHexToAssColor = exports.strContainsPunctuation = exports.getEnumKeyByValue = exports.getSampleItems = exports.insertTriplet = exports.appequal = exports.uuid = void 0; | ||
const uuid_1 = require("uuid"); | ||
const lodash_1 = require("lodash"); | ||
const PUNCTUATIONS = [ | ||
@@ -84,2 +85,20 @@ '!', | ||
exports.convertHexToAssColor = convertHexToAssColor; | ||
const insertTriplet = (arr, a, b, c) => { | ||
const n = arr.length / 3; | ||
arr.splice(n * 1, 0, a); | ||
arr.splice(n * 2 + 1, 0, b); | ||
arr.splice(n * 3 + 2, 0, c); | ||
return arr; | ||
}; | ||
exports.insertTriplet = insertTriplet; | ||
const getSampleItems = (items, count) => { | ||
if (items.length === 0) | ||
return items; | ||
let randoms = (0, lodash_1.sampleSize)(items, count); | ||
while (randoms.length < count) { | ||
randoms = randoms.concat((0, lodash_1.sample)(items)); | ||
} | ||
return randoms.slice(0, count); | ||
}; | ||
exports.getSampleItems = getSampleItems; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "ffaivideo", | ||
"version": "1.6.8", | ||
"version": "1.7.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
274404
2716