Skip to content

Commit

Permalink
[encode] Don't use : in filenames on windows
Browse files Browse the repository at this point in the history
Mentionned in #30
  • Loading branch information
occivink committed Sep 25, 2019
1 parent e9151e3 commit 2b635f2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/encode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ local utils = require "mp.utils"
local msg = require "mp.msg"
local options = require "mp.options"

local ON_WINDOWS = (package.config:sub(1,1) ~= "/")

local start_timestamp = nil
local profile_start = ""

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

0 comments on commit 2b635f2

Please sign in to comment.