From 68edf1079f7d7ef4edbae7ff8fcc35005de97012 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:45 -0400 Subject: [PATCH] q/qlvideo: update livecheck --- Casks/q/qlvideo.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Casks/q/qlvideo.rb b/Casks/q/qlvideo.rb index 93010c6536..7233f4a80e 100644 --- a/Casks/q/qlvideo.rb +++ b/Casks/q/qlvideo.rb @@ -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