Improve chapter generation performance by reusing elements

Also ensure large segments don't break chapter bar
This commit is contained in:
Ajay
2022-02-23 01:06:08 -05:00
parent 9654fabc3c
commit ea91701430
2 changed files with 45 additions and 25 deletions

View File

@@ -808,7 +808,7 @@ async function sponsorsLookup(id: string, keepOldSubmissions = true) {
}
// Add existing chapters if we can
if (utils.chaptersEnabled()) {
if (Config.config.renderAsChapters) {
GenericUtils.wait(() => getExistingChapters(sponsorVideoID, video.duration),
5000, 100, (c) => c?.length > 0).then((chapters) => {
if (chapters?.length > 0) {