Skip to content

Commit 2b635f2

Browse files
committed
[encode] Don't use : in filenames on windows
Mentionned in #30
1 parent e9151e3 commit 2b635f2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

scripts/encode.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ local utils = require "mp.utils"
22
local msg = require "mp.msg"
33
local options = require "mp.options"
44

5+
local ON_WINDOWS = (package.config:sub(1,1) ~= "/")
6+
57
local start_timestamp = nil
68
local profile_start = ""
79

@@ -55,6 +57,9 @@ function get_output_string(dir, format, input, extension, title, from, to, profi
5557
output = string.gsub(output, "$d", seconds_to_time_string(to-from, true))
5658
output = string.gsub(output, "$x", extension)
5759
output = string.gsub(output, "$p", profile)
60+
if ON_WINDOWS then
61+
output = string.gsub(output, ":", "_")
62+
end
5863
if not string.find(output, "$n") then
5964
return files[output] and nil or output
6065
end

0 commit comments

Comments
 (0)