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
47 if #dir == 0 then47 if #dir == 0 then
48 return48 return
49 end49 end
50 local isplaylist = mp.get_property("playlist-count")50 local pl_count = mp.get_property_number("playlist-count", 1)
51 if #isplaylist > 1 then51 if (pl_count > 1 and autoload == nil) or
52 (pl_count == 1 and EXTENSIONS[string.lower(get_extension(filename))] == nil) then
52 return53 return
54 else
55 autoload = true
53 end56 end
54 57
55 local files = mputils.readdir(dir, "files")58 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