소스 검색

Launceston Updates

Benjamin Harris 2 달 전
부모
커밋
c0b8aece5f
3개의 변경된 파일9개의 추가작업 그리고 5개의 파일을 삭제
  1. 2 1
      .claude/settings.local.json
  2. 7 2
      lib/enrich.rb
  3. 0 2
      scrapers/launcestoncity.rb

+ 2 - 1
.claude/settings.local.json

@@ -7,7 +7,8 @@
       "Bash(grep -v \"next\\\\s*$\")",
       "Bash(grep -n -B3 \"^\\\\s*rescue\\\\s*$\\\\|^rescue\\\\s*$\" \"f:/GIT_REPO/tas_councils/scrapers/centralcoast.rb\" \"f:/GIT_REPO/tas_councils/scrapers/circularhead.rb\" \"f:/GIT_REPO/tas_councils/scrapers/clarence.rb\" \"f:/GIT_REPO/tas_councils/scrapers/flinders_council.rb\" \"f:/GIT_REPO/tas_councils/scrapers/georgetown.rb\" \"f:/GIT_REPO/tas_councils/scrapers/glamorgan.rb\" \"f:/GIT_REPO/tas_councils/scrapers/glenorchy.rb\" \"f:/GIT_REPO/tas_councils/scrapers/huonvalley.rb\" \"f:/GIT_REPO/tas_councils/scrapers/tasman.rb\" \"f:/GIT_REPO/tas_councils/scrapers/westtamar.rb\" \"f:/GIT_REPO/tas_councils/scrapers/meandervalley.rb\" \"f:/GIT_REPO/tas_councils/scrapers/devonportcity.rb\" \"f:/GIT_REPO/tas_councils/scrapers/dorset.rb\" \"f:/GIT_REPO/tas_councils/scrapers/launcestoncity.rb\" \"f:/GIT_REPO/tas_councils/scrapers/waratah_wynyard.rb\")",
       "Bash(ruby test/test_util.rb)",
-      "Bash(docker compose:*)"
+      "Bash(docker compose:*)",
+      "Bash(python3)"
     ]
   }
 }

+ 7 - 2
lib/enrich.rb

@@ -101,8 +101,13 @@ def enrich_after_upsert!(table:, council_reference:, address:)
       if resp["ok"]
         pid   = (resp["pid"] || "").to_s
         title = (resp["title_id"] || "").to_s
-        upd = DB.client.prepare("UPDATE `#{esc}` SET property_id = COALESCE(NULLIF(?,’’), property_id), title_reference = COALESCE(NULLIF(?,’’), title_reference) WHERE council_reference = ? AND address = ?")
-        upd.execute(pid, title, council_reference, address)
+        upd = DB.client.prepare(
+          "UPDATE `#{esc}` SET " \
+          "property_id    = IF(? <> ‘’, ?, property_id), " \
+          "title_reference = IF(? <> ‘’, ?, title_reference) " \
+          "WHERE council_reference = ? AND address = ?"
+        )
+        upd.execute(pid, pid, title, title, council_reference, address)
         Log.debug "enrich", "lookup ok #{table} #{council_reference} pid=#{pid} title=#{title}"
       else
         Log.warn "enrich", "lookup error #{table} #{council_reference}: #{resp["error"]}"

+ 0 - 2
scrapers/launcestoncity.rb

@@ -401,8 +401,6 @@ tables.each do |t|
 					warn "Probe fallback failed for #{council_reference}: #{e.class} #{e.message}"
 				  end
 
-				  if anchors_added == 0
-					warn "Docs page had no usable links for #{council_reference} after variants."
 				  end
 				end