-
-
Save iliakan/800330a6a985f434a10dd08912fdc9d0 to your computer and use it in GitHub Desktop.
Delete current file on disk and playlist in VLC (OSX only)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Copyright 2020 wizard | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
GNU General Public License for more details. | |
You should have received a copy of the GNU General Public License | |
along with this program. If not, see <http://www.gnu.org/licenses/>. | |
]]-- | |
function descriptor() | |
return { | |
title = "VLC Delete OSX"; | |
version = "0.2"; | |
author = "wizard"; | |
shortdesc = "Remove current file from playlist and disk"; | |
description = [[ | |
<h1>vlc-delete</h1>" | |
VLC Delete OSX can delete the current file from your playlist and <b>disk</b> with one click.<br> | |
This extension has been tested on OSX 15.x+ with VLC 3.0.11.<br> | |
The author is not responsible for damage caused by this extension. | |
]]; | |
} | |
end | |
function removeItem() | |
local id = vlc.playlist.current() | |
vlc.playlist.delete(id) | |
vlc.playlist.gotoitem(id + 1) | |
vlc.deactivate() | |
end | |
function activate() | |
local item = vlc.input.item() | |
local uri = item:uri() | |
uri = string.gsub(uri, '^file:///', '') | |
uri = vlc.strings.decode_uri(uri) | |
vlc.msg.info("[vlc-delete] removing: " .. uri) | |
os.execute("rm -f \"" .. uri .. "\"") | |
removeItem() | |
end | |
function deactivate() | |
vlc.deactivate() | |
end | |
function close() | |
deactivate() | |
end | |
function meta_changed() | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment