Skip to content

Commit 65aa1da

Browse files
authored
Merge pull request #88 from kaoneko/patch-1
[blacklist-extensions.lua] Check if playlist entry is directory before removing
2 parents d0390c8 + 13ead7d commit 65aa1da

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/blacklist-extensions.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ opts = {
66
}
77
(require 'mp.options').read_options(opts)
88
local msg = require 'mp.msg'
9+
local utils = require 'mp.utils'
910

1011
function split(input)
1112
local ret = {}
@@ -42,9 +43,13 @@ else
4243
end
4344

4445
function should_remove(filename)
45-
if string.find(filename, "://") then
46+
47+
-- don't remove playlist entry if it's a stream or directory
48+
local file = utils.file_info(filename)
49+
if not file or file.is_dir then
4650
return false
4751
end
52+
4853
local extension = string.match(filename, "%.([^./]+)$")
4954
if not extension and opts.remove_files_without_extension then
5055
return true

0 commit comments

Comments
 (0)