Files
yay/doc/examples/hide_first_submitted.lua
Jo 4dbf124c51 feat(lua): add search filter and post install hooks (#2867)
* search filter and post install

add examples

* add tag
2026-06-16 23:35:18 +02:00

17 lines
589 B
Lua

yay.create_autocmd("SearchFilter", {
desc = "hide AUR packages submitted in the last 14 days",
callback = function(event)
yay.log.info("hiding AUR packages submitted in the last 14 days")
local out = {}
local cutoff = os.time() - (14 * 24 * 60 * 60)
for _, r in ipairs(event.data.results) do
if r.source == "aur" and r.first_submitted ~= -1 and r.first_submitted >= cutoff then
yay.log.debug("hiding newly submitted AUR package: ", r.name)
else
out[#out + 1] = { source = r.source, name = r.name }
end
end
return out
end,
})