aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-01 17:00:57 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-03-01 17:00:57 -0500
commita6efd62123483d379b68554de374d8dbee5d7b77 (patch)
treea1eafdd08bd628182dad3a24305062919a0f77c9
parent423a29bff247ecce00bc5383b28fa7624ef67dcf (diff)
Match against place name as well
-rwxr-xr-xnowopen14
1 files changed, 10 insertions, 4 deletions
diff --git a/nowopen b/nowopen
index a3981b5..a70530e 100755
--- a/nowopen
+++ b/nowopen
@@ -115,13 +115,19 @@ local function get_weekday(str)
end
end
+local function matches_tag(place, request_tag)
+ if place.name:sub(1,#request_tag):lower() == request_tag:lower() then return true end
+ for _,tag in ipairs(place.tags) do
+ if tag:sub(1,#request_tag):lower() == request_tag:lower() then return true end
+ end
+ return false
+end
+
local function matches_tags(place, tags)
for _,request_tag in ipairs(tags) do
- for _,tag in ipairs(place.tags) do
- if tag:sub(1,#request_tag) == request_tag then goto next_tag end
+ if not matches_tag(place, request_tag) then
+ return false
end
- if true then return false end
- ::next_tag::
end
return true
end