Skip to content

Commit

Permalink
Add more instrumentation when we get an NPE finding track bank.
Browse files Browse the repository at this point in the history
  • Loading branch information
brunchboy committed Nov 23, 2024
1 parent 29bdef1 commit 94fcd01
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/beat_link_trigger/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -447,17 +447,21 @@
"Given a song structure tag parsed from a track, returns the bank that
was assigned to the track as a keyword for matching in code."
[^RekordboxAnlz$SongStructureTag tag]
(case-enum (.bank (.body tag))
RekordboxAnlz$TrackBank/CLUB_1 :club-1
RekordboxAnlz$TrackBank/CLUB_2 :club-2
RekordboxAnlz$TrackBank/COOL :cool
RekordboxAnlz$TrackBank/DEFAULT :cool
RekordboxAnlz$TrackBank/HOT :hot
RekordboxAnlz$TrackBank/NATURAL :natural
RekordboxAnlz$TrackBank/SUBTLE :subtle
RekordboxAnlz$TrackBank/VIVID :vivid
RekordboxAnlz$TrackBank/WARM :warm
(timbre/error "Unrecognized track bank" (.bank (.body tag)))))
(try
(case-enum (.bank (.body tag))
RekordboxAnlz$TrackBank/CLUB_1 :club-1
RekordboxAnlz$TrackBank/CLUB_2 :club-2
RekordboxAnlz$TrackBank/COOL :cool
RekordboxAnlz$TrackBank/DEFAULT :cool
RekordboxAnlz$TrackBank/HOT :hot
RekordboxAnlz$TrackBank/NATURAL :natural
RekordboxAnlz$TrackBank/SUBTLE :subtle
RekordboxAnlz$TrackBank/VIVID :vivid
RekordboxAnlz$TrackBank/WARM :warm
(timbre/error "Unrecognized track bank" (.bank (.body tag))))
(catch NullPointerException e
(timbre/error e "Unable to determine track bank! tag:" tag "body:" (.body tag)
"bank:" (.bank (.body tag))))))

(defn track-mood-name
"Given a song structure tag parsed from a track, returns the mood that
Expand Down

0 comments on commit 94fcd01

Please sign in to comment.