From c5df0a064cb347e5844172825a8d2f41029dfcc4 Mon Sep 17 00:00:00 2001 From: Christoph Marzell Date: Sun, 7 Dec 2025 09:42:43 +0100 Subject: [PATCH] fixes --- app/services/training_watch/checker.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/services/training_watch/checker.rb b/app/services/training_watch/checker.rb index 31984e1..c083b97 100644 --- a/app/services/training_watch/checker.rb +++ b/app/services/training_watch/checker.rb @@ -32,7 +32,7 @@ module TrainingWatch @sources.find_each do |source| begin new_hits = check_one!(source) - results << Result.new(source:, new_hits:) if new_hits.any? + results << Result.new(source: source, new_hits: new_hits) if new_hits.any? rescue => e @logger.warn("[TrainingWatch] source=#{source.id} #{source.name} failed: #{e.class}: #{e.message}") ensure @@ -97,7 +97,7 @@ module TrainingWatch label = a.text.to_s.gsub(/\s+/, " ").strip abs = absolutize_url(source.url, href) - { label:, url: abs } + { label: label, url: abs } end.compact # Wenn Links explizit 2027 enthalten, priorisieren, sonst Seitenhit @@ -107,7 +107,7 @@ module TrainingWatch if link_hits.any? link_hits.each do |c| hits << create_hit!( - source:, + source: source, title: c[:label].presence || page_title, hit_url: c[:url], snippet: build_snippet(text, regex) @@ -115,7 +115,7 @@ module TrainingWatch end else hits << create_hit!( - source:, + source: source, title: page_title || source.name, hit_url: source.url, snippet: build_snippet(text, regex) @@ -133,7 +133,7 @@ module TrainingWatch return [] unless body.match?(regex) create = create_hit!( - source:, + source: source, title: source.name, hit_url: source.url, snippet: build_snippet(body.gsub(/\s+/, " "), regex) @@ -173,7 +173,7 @@ module TrainingWatch title: title.to_s.strip.presence, hit_url: hit_url.to_s.strip.presence, snippet: snippet.to_s.strip.presence, - published_at:, + published_at: published_at, fingerprint: fp ) rescue ActiveRecord::RecordNotUnique