
Playlist Cleaner
Source (link to git-repo or to original if based on someone elses unmodified work):
Description:
Playlist Cleaner is a LUA extension for VLC which checks the active playlist for files that are duplicates, deleted, or otherwise moved; and if so, removes them from the playlist. This prevents you from seeing "VLC file not found" errors. I could not find any addons along these lines for VLC, so I decided to make one myself. This is my first routine in LUA so advice or suggestions for improvement would be appreciated. Last changelog:
V1.0 (11/15/2012) : First release.
V1.1 (11/27/2012) : Noticed script was accidentally removing directories from the playlist, updated it to only remove items when the I/O error code returned is "File/Folder not found."
V1.2 (12/31/2013) : Added support for cleaning out duplicate files in the playlist. Added a simple interface to control what to clean up from the playlist.
Ratings & Comments
17 Comments
10 Forgot to rank.
MAGIC!! Thank you!
Does it remove duplicate entries in the playlist or duplicate files? My playlist has gone huge and slow because each entry was somehow duplicated.
Sorry. Found the answer. It works! Thank you!
9 9 excellent
Great extension, thanks! I had duplicates in my list that had different encoding in the path so this extension didn't pick them up. Making the following change allowed this extension to pick up those duplicates too: On line 48: if fileset[v.path] then change to: if fileset[unescape(v.path)] then and similarly on line 52: fileset[v.path] = 1 change to fileset[unescape(v.path)] = 1 Hope this helps other peeps out there :)
Thx
If you want to use this extension on Linux (I'm using Linux Mint 19), then you might need to make this small change. On line 68: local pathval = string.gsub(filepath, "file:\/\/\/", "") change to: local pathval = string.gsub(filepath, "file://", "") If you're using linux and the extension isn't visible in "Plugins and extensions" after you've installed it, then you may want to try this change. To confirm, enable VLC logging then restart VLC. If you have the below error message in your logs, then you probably need to make the change. "Error loading script /usr/lib/x86_64-linux-gnu/vlc/lua/extensions/155249-playlist.lua: .../x86_64-linux-gnu/vlc/lua/extensions/155249-playlist.lua:68: invalid escape sequence near '\/'" I hopes this helpful.
Line 72, after io.open line, I added: if file~=nil then file:close() end it seems to work better for me
I cant get the plugin to show up in the View menu on Arch Linux? Does the plugin support Linux? If not will it ever?
I've downloaded it. I try to double click... no way to open it, says computer. Doesn't recognize this type of file. How do I import it to VLC? My playlist is multiplying entries at an alarming rate!
You would want to drop the file in your VLC folder, in the subfolder \lua\extensions Playlist Cleaner will show up the next time you open "VLC" under the View menu, click on "Cleans orphaned and duplicate tracks from the playlist."
Thanks very much!
2.1.3 crashes every time i try to use the plugin.
I'm without a laptop right now, but I'm really sorry that's happening for you. I will try to take a look at it when my situation gets sorted out in the next week or so.
Still crashing. Would be a very useful addon for me if it worked.
It works fine! tHANK yOU!