Add torrent hash to custom script variables

I am probably in the minority but I have scripts that frequently manipulate the torrents on events, such as changing the label after import and such. The problem is the torrent name is the only information Sonarr makes available to link to a torrent (which can change after a magnet link is downloaded BTW) and nearly all torrent program APIs require the torrent hash as the identifier. That makes things difficult. I think it would be good to include the torrent hash because of this.

Makes sense to me, I’ve opened a PR:

Awesome markus101! Thanks! That will make things SO much easier.

Just got the latest with this version and am pleased to see this included. One question though, how does “sonarr_download_id” work for NZB? Is it just null? I don’t have usenet to test for myself and I plan on updating the wiki.

If Sonarr knows the ID it will be set, otherwise null, it’s not treated differently between torrents and usenet.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.