fix: lax chapter range patterns producing false positives (#454)

This commit is contained in:
christoph-heinrich
2023-02-16 20:26:06 +01:00
committed by GitHub
parent 94ec120923
commit 1dfbbd7091

View File

@@ -428,10 +428,23 @@ end
function serialize_chapter_ranges(normalized_chapters)
local ranges = {}
local simple_ranges = {
{name = 'openings', patterns = {'^op ', '^op$', ' op$', 'opening$'}, requires_next_chapter = true},
{name = 'intros', patterns = {'^intro$'}, requires_next_chapter = true},
{name = 'endings', patterns = {'^ed ', '^ed$', ' ed$', 'ending$', 'closing$'}},
{name = 'outros', patterns = {'^outro$'}},
{name = 'openings', patterns = {
'^op ', '^op$', ' op$',
'^opening$', ' opening$'
}, requires_next_chapter = true},
{name = 'intros', patterns = {
'^intro$', ' intro$',
'^avant$', '^prologue$'
}, requires_next_chapter = true},
{name = 'endings', patterns = {
'^ed ', '^ed$', ' ed$',
'^ending ', '^ending$', ' ending$',
}},
{name = 'outros', patterns = {
'^outro$', ' outro$',
'^closing$', '^closing ',
'^preview$', '^pv$',
}},
}
local sponsor_ranges = {}