You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't know if this plugin works in other OSes, but in Windows (10/11) it surely didn't work, so I had to do many fixes and turn this plugin into Windows only using only core Windows batch functions for operations
#11
Closed
vivek1986 opened this issue
Jul 27, 2022
· 5 comments
Don't know if this plugin works in other OSes, but in Windows (10/11) it surely didn't work, so I had to do many fixes and turn this plugin into Windows only using only core Windows batch functions for operations.
So in hopes that this inspires others here to rectify the errors in the Lua libraries so that they don't throw errors when dealing with File I/O operations in Windows, here's the code and the Stackoverflow page where also I mentioned this as an answer to my own question:
-- Copy this file to %ProgramFiles%\VideoLAN\VLC\lua\extensions\ and restart VLC Media player.functiondescriptor()
return {
title="VLC Delete Media File(Windows only)";
version="1.0";
author="Vicky Dev";
shortdesc="&Remove current file from playlist and disk";
description=[[<h1>VLC Delete Media File(Windows only)</h1>"When you're playing a file, use this to easilydelete the current file from your <b>playlist</b> and <b>disk</b> with one click.<br>Disclaimer: The author is not responsible for damage caused by this extension.]];
}
endfunctionsleep(seconds)
localt0=os.clock()
localtOriginal=t0whileos.clock() -t0<=secondsandos.clock() >=tOriginaldoendendfunctionremoveItem()
localid=vlc.playlist.current()
vlc.playlist.delete(id)
vlc.playlist.gotoitem(id+1)
vlc.deactivate()
endfunctionactivate()
localitem=vlc.input.item()
localuri=item:uri()
uri=string.gsub(uri, "^file:///", "")
uri=vlc.strings.decode_uri(uri)
path=string.gsub(uri, "/", "\\")
vlc.msg.info("[VLC Delete Media File(Windows only)] removing: "..uri.." : "..path)
removeItem()
retval, err=os.execute("if exist ".."\""..path.."\"".." @(call )")
if (type(retval) =='number' andretval==0) thenos.execute("del /f /a /q ".."\""..path.."\"")
endendfunctionclick_ok()
d:delete()
vlc.deactivate()
endfunctiondeactivate()
vlc.deactivate()
endfunctionclose()
deactivate()
endfunctionmeta_changed()
end
The text was updated successfully, but these errors were encountered:
Don't know if this plugin works in other OSes, but in Windows (10/11) it surely didn't work, so I had to do many fixes and turn this plugin into Windows only using only core Windows batch functions for operations.
[...]
Thanks for your investigations(!) 🤗
Could you please create a pull request to the new branch https://github.com/surrim/vlc-delete/tree/master-windows-only if possible? At the moment I don't have a PC with me. Maybe somebody else could modify the branch that I can later merge it back into the master branch. I'm really no Lua expert :)
@surrim I tried but I am getting this error when I try to push from my local repo copy to origin(master-windows-only):
remote: Permission to surrim/vlc-delete.git denied to vivek1986.
fatal: unable to access 'https://github.com/surrim/vlc-delete.git/': The requested URL returned error: 403
@surrim I tried but I am getting this error when I try to push from my local repo copy to origin(master-windows-only):
remote: Permission to surrim/vlc-delete.git denied to vivek1986.
fatal: unable to access 'https://github.com/surrim/vlc-delete.git/': The requested URL returned error: 403
You can fork this project, then push to your own, and finally create a pull request on GitHub 😉
See creating-a-pull-request if you are not sure how it works.
Don't know if this plugin works in other OSes, but in Windows (10/11) it surely didn't work, so I had to do many fixes and turn this plugin into Windows only using only core Windows batch functions for operations.
So in hopes that this inspires others here to rectify the errors in the Lua libraries so that they don't throw errors when dealing with File I/O operations in Windows, here's the code and the Stackoverflow page where also I mentioned this as an answer to my own question:
The text was updated successfully, but these errors were encountered: