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.
Unified · Split
| @@ -47,9 +47,12 @@ function find_and_add_entries() · 46 unmodified lines | |||
| 47 | if #dir == 0 then | 47 | if #dir == 0 then |
| 48 | return | 48 | return |
| 49 | end | 49 | end |
| 50 | local isplaylist = mp.get_property("playlist-count") | 50 | local pl_count = mp.get_property_number("playlist-count", 1) |
| 51 | if #isplaylist > 1 then | 51 | if (pl_count > 1 and autoload == nil) or |
| 52 | (pl_count == 1 and EXTENSIONS[string.lower(get_extension(filename))] == nil) then | ||
| 52 | return | 53 | return |
| 54 | else | ||
| 55 | autoload = true | ||
| 53 | end | 56 | end |
| 54 | 57 | ||
| 55 | local files = mputils.readdir(dir, "files") | 58 | local files = mputils.readdir(dir, "files") |