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