fix: ads end could be recognized as single chapter ad (#263)

This commit is contained in:
christoph-heinrich
2022-09-25 09:52:06 +02:00
committed by GitHub
parent caf98dd28f
commit 4c219a6b00

View File

@@ -906,7 +906,8 @@ function serialize_chapter_ranges(normalized_chapters)
break
end
end -- single chapter for ad
elseif chapter.lowercase_title:find('%[sponsorblock%]:') or chapter.lowercase_title:find('^sponsors?') then
elseif not chapter.is_end_only and
(chapter.lowercase_title:find('%[sponsorblock%]:') or chapter.lowercase_title:find('^sponsors?')) then
local next_chapter = chapters[i + 1]
ranges[#ranges + 1] = table_assign({
start = chapter.time,