Update delete-current-file.lua
This commit is contained in:
@@ -23,6 +23,7 @@ function confirm()
|
|||||||
|
|
||||||
local count = mp.get_property_number("playlist-count")
|
local count = mp.get_property_number("playlist-count")
|
||||||
local pos = mp.get_property_number("playlist-pos")
|
local pos = mp.get_property_number("playlist-pos")
|
||||||
|
local newPos = 0
|
||||||
|
|
||||||
if pos == count - 1 then
|
if pos == count - 1 then
|
||||||
newPos = pos - 1
|
newPos = pos - 1
|
||||||
@@ -31,6 +32,7 @@ function confirm()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if newPos > -1 then
|
if newPos > -1 then
|
||||||
|
mp.command("set pause no")
|
||||||
mp.set_property_number("playlist-pos", newPos)
|
mp.set_property_number("playlist-pos", newPos)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -42,7 +44,8 @@ function confirm()
|
|||||||
[Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile('FileToDelete', 'OnlyErrorDialogs', 'SendToRecycleBin')
|
[Microsoft.VisualBasic.FileIO.FileSystem]::DeleteFile('FileToDelete', 'OnlyErrorDialogs', 'SendToRecycleBin')
|
||||||
}]]
|
}]]
|
||||||
|
|
||||||
ps_code = string.gsub(ps_code, "FileToDelete", FileToDelete)
|
local escapedFileToDelete = string.gsub(FileToDelete, "'", "''")
|
||||||
|
ps_code = string.gsub(ps_code, "FileToDelete", escapedFileToDelete)
|
||||||
|
|
||||||
mp.command_native({
|
mp.command_native({
|
||||||
name = "subprocess",
|
name = "subprocess",
|
||||||
|
|||||||
Reference in New Issue
Block a user