Sonarr queue and history records do not expose episodeNumber at the top level — it is only present inside the nested episode object (record.episode.episodeNumber). Same for seasonNumber. The original extractEpisode() read record.episodeNumber which was always undefined, so gatherEpisodes() always returned an empty array. Fix: prefer the nested episode object fields, falling back to the top-level fields for forward-compatibility.