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] local filename = split(value, " ")[1]
for key2, value2 in ipairs(resultTable) do for key2, value2 in ipairs(resultTable) do
local valueTable = split(value2, " ") local valueTable = split(value2, " ")
local filePath = path .. program .. "/" .. valueTable[1] if filename == valueTable[1] then
if valueTable[2] == "delete" and fs.exists(filePath) then local filePath = path .. program .. "/" .. valueTable[1]
fs.delete(filePath) if valueTable[2] == "delete" and fs.exists(filePath) then
elseif valueTable[2] == "download" then fs.delete(filePath)
finalResult[#finalResult + 1] = valueTable[1] elseif valueTable[2] == "download" then
finalResult[#finalResult + 1] = valueTable[1]
end
end end
end end
end end