History

TOOLS/lua/autoload: fix adding more files at end of auto-playlist

Fixes regression in dfd8a5f that made autoload not add more files at the end of the current playlist if playlist was made by the script. This still prevents loading the script if more than one (media or playlist) file was manually added.

Ricardo Constantino committed 11 years ago

Commit b144da61 parent 9cd929b1 file · +5 −2Browse files

Unified · Split

TOOLS/lua/autoload.lua+5−2
@@ -47,9 +47,12 @@ function find_and_add_entries() · 46 unmodified lines
4747 if #dir == 0 then
4848 return
4949 end
50− local isplaylist = mp.get_property("playlist-count")
51− if #isplaylist > 1 then
50+ local pl_count = mp.get_property_number("playlist-count", 1)
51+ if (pl_count > 1 and autoload == nil) or
52+ (pl_count == 1 and EXTENSIONS[string.lower(get_extension(filename))] == nil) then
5253 return
54+ else
55+ autoload = true
5356 end
5457
5558 local files = mputils.readdir(dir, "files")

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t