I just had to do this for qBittorrent, works like a charm :)
It's the following instructions that made it clear for me (note for qBittorrent it's qBittorrent.desktop, it is case sensitive).
"Let me explain this again
Firstly we need to check that your program's ".desktop file" (in /usr/share/applications) has this line:
To check, open the text editor (called gedit) and hit "open" up to the left, then navigate to your program's .desktop file. As stated; you should find it in the folder /usr/share/applications. After you open it, search for "MimeType" (by pressing Ctrl+f and typing "MimeType" in the box that shows up).
...If you did find that it has this line then proceed. (if not then just paste the line wherever in between the lines. Or if you find the line incomplete then you can modify the existing line.) Close gedit.
Now that we've done the checking; open the file /usr/share/applications/defaults.list (the same way you opened the .desktop file). Search for "x-scheme-handler/magnet" (same way also). If you found it, make it look like this;
Replace YOURPROGRAM by the program you want to set default. The name must exactly match the name of your program's .desktop file.
And you're done!"