Fixed issue where callsign was redundantly tweeted.

This commit is contained in:
John Wiseman 2020-09-26 22:09:56 -07:00
parent 05b96b612b
commit 0f07b705c1

View File

@ -523,19 +523,20 @@
(defn template-data [ac ac-db-rec reverse nearby]
(let [rev-props (:properties reverse)
nearby (:properties nearby)
info (cond-> (-> ac
info (-> ac
(dissoc :history :type)
(merge rev-props)
(merge-adsbx-aircraft-db-rec ac-db-rec))
info (cond-> info
(:military? ac)
(-> (assoc :militaryregistration (:registration ac)
:militaryicao (:icao ac)))
(-> (assoc :militaryregistration (:registration info)
:militaryicao (:icao info)))
nearby
(assoc :nearbylandmark (:name nearby)
:nearbydistance (-> nearby :distance km->miles (to-fixed 2)))
(:speed ac)
(assoc :speed (.toFixed (* (:speed ac) 1.15078) 0))
(= (:registration ac) (:callsign ac))
(:speed info)
(assoc :speed (.toFixed (* (:speed info) 1.15078) 0))
(= (:registration info) (:callsign info))
(dissoc :callsign)
;; TODO: If layer is "county", find the nearest city.
)]