diff --git a/lib/aprsme_web/live/map_live/packet_utils.ex b/lib/aprsme_web/live/map_live/packet_utils.ex index ba32f86..2e922f4 100644 --- a/lib/aprsme_web/live/map_live/packet_utils.ex +++ b/lib/aprsme_web/live/map_live/packet_utils.ex @@ -62,8 +62,21 @@ defmodule AprsmeWeb.MapLive.PacketUtils do @spec has_weather_packets?(String.t()) :: boolean() # Get recent packets for this callsign and check if any are weather packets def has_weather_packets?(callsign) when is_binary(callsign) do - # Use cached query for better performance - Aprsme.CachedQueries.has_weather_packets_cached?(callsign) + # Direct query without caching + import Ecto.Query + + query = + from p in Aprsme.Packet, + where: p.sender == ^callsign, + where: + not is_nil(p.temperature) or not is_nil(p.humidity) or not is_nil(p.pressure) or + not is_nil(p.wind_direction) or not is_nil(p.wind_speed) or not is_nil(p.wind_gust) or + not is_nil(p.rain_1h) or not is_nil(p.rain_24h) or not is_nil(p.rain_midnight) or + not is_nil(p.luminosity) or not is_nil(p.snow_24h), + select: fragment("1"), + limit: 1 + + Aprsme.Repo.exists?(query) rescue _ -> false end