tweak special chars filter

This commit is contained in:
Ren Tatsumoto 2021-12-29 12:19:15 +03:00
parent 65337f6aec
commit 9708821194

View file

@ -76,7 +76,7 @@ local function remove_text_in_brackets(str)
end end
local function remove_special_characters(str) local function remove_special_characters(str)
return str:gsub('[%c%p%s]', '') return str:gsub('[%-_]', ' '):gsub('[%c%p]', ''):gsub('%s+', ' ')
end end
local function human_readable_time(seconds) local function human_readable_time(seconds)
@ -108,7 +108,7 @@ local function construct_filename()
filename = remove_special_characters(filename) filename = remove_special_characters(filename)
filename = string.format( filename = string.format(
'%s_(%s-%s)', '%s (%s-%s)',
filename, filename,
human_readable_time(main_menu.timings['start']), human_readable_time(main_menu.timings['start']),
human_readable_time(main_menu.timings['end']) human_readable_time(main_menu.timings['end'])
@ -496,7 +496,6 @@ function pref_menu:cycle_audio_bitrates()
self:update() self:update()
end end
function pref_menu:cycle_formats(config_type) function pref_menu:cycle_formats(config_type)
local formats local formats
if config_type == 'video_format' then if config_type == 'video_format' then