deduplicate redownloads

This commit is contained in:
jane 2021-06-06 00:51:47 -04:00
parent 7c34250e35
commit 0de38f49a8

View file

@ -89,11 +89,13 @@ local function getAllFiles(program)
local filename = split(value, " ")[1]
for key2, value2 in ipairs(resultTable) do
local valueTable = split(value2, " ")
local filePath = path .. program .. "/" .. valueTable[1]
if valueTable[2] == "delete" and fs.exists(filePath) then
fs.delete(filePath)
elseif valueTable[2] == "download" then
finalResult[#finalResult + 1] = valueTable[1]
if filename == valueTable[1] then
local filePath = path .. program .. "/" .. valueTable[1]
if valueTable[2] == "delete" and fs.exists(filePath) then
fs.delete(filePath)
elseif valueTable[2] == "download" then
finalResult[#finalResult + 1] = valueTable[1]
end
end
end
end