q/qlvideo: update livecheck

This commit is contained in:
Sam Ford
2023-09-30 00:29:22 -04:00
parent 3e00a86867
commit 68edf1079f
+8 -5
View File
@@ -8,12 +8,15 @@ cask "qlvideo" do
homepage "https://github.com/Marginal/QLVideo"
livecheck do
url "https://api.github.com/repos/Marginal/QLVideo/releases/latest"
strategy :page_match do |page|
match = page.match(/QLVideo[._-]v?(\d+?)(\d+)\.dmg/i)
next if match.blank?
url :url
regex(/^QLVideo[._-]v?(\d+?)(\d+)\.dmg$/i)
strategy :github_latest do |json, regex|
json["assets"]&.map do |asset|
match = asset["name"]&.match(regex)
next if match.blank?
"#{match[1]}.#{match[2]}"
"#{match[1]}.#{match[2]}"
end
end
end