Skip to content

Commit 86ab104

Browse files
fix blank filename (#149)
1 parent 790688c commit 86ab104

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

utils/filename_factory.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,18 @@ end)()
5050
local make_media_filename = function()
5151
filename = mp.get_property("filename") -- filename without path
5252
filename = h.remove_extension(filename)
53-
filename = h.remove_filename_text_in_parentheses(filename)
54-
filename = h.remove_text_in_brackets(filename)
55-
filename = h.remove_special_characters(filename)
53+
54+
local operations = {
55+
h.remove_filename_text_in_parentheses,
56+
h.remove_text_in_brackets,
57+
h.remove_special_characters
58+
}
59+
for _, f in ipairs(operations) do
60+
local temp_filename = f(filename)
61+
if temp_filename ~= "" then
62+
filename = temp_filename
63+
end
64+
end
5665
end
5766

5867
local function timestamp_range(start_timestamp, end_timestamp, extension)

0 commit comments

Comments
 (0)