Skip to content

Commit

Permalink
Update delete-file.lua
Browse files Browse the repository at this point in the history
Added blocking code (playback_only = false) to prevent conflicts with other scripts
  • Loading branch information
samhippo authored Apr 27, 2020
1 parent 551f8da commit d239abc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion delete-file.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
local utils = require "mp.utils"
function main()
mp.commandv('pause')
local fileToDelete = string.gsub(mp.get_property("path"), "/", "\\")
mp.commandv('run','cmd.exe', '/C', 'del', fileToDelete)
local args = {'cmd.exe', '/C', 'del', fileToDelete}
utils.subprocess({args = args, playback_only = false})
mp.commandv('playlist-remove','current')
end
mp.register_script_message("delete-file", main)

0 comments on commit d239abc

Please sign in to comment.