diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-01 17:00:57 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-01 17:00:57 -0500 |
| commit | a6efd62123483d379b68554de374d8dbee5d7b77 (patch) | |
| tree | a1eafdd08bd628182dad3a24305062919a0f77c9 | |
| parent | 423a29bff247ecce00bc5383b28fa7624ef67dcf (diff) | |
Match against place name as well
| -rwxr-xr-x | nowopen | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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 |
