tympanix / Electorrent

A remote control client for µTorrent, qBittorrent, rTorrent, Transmission, Synology & Deluge
GNU General Public License v3.0
1.02k stars 84 forks source link

[Feature Request] Add torrent dialog for magnet links. #329

Open testbughub opened 1 year ago

testbughub commented 1 year ago

It would be nice to be able to set a category/label before adding a magnet link.

journeym commented 1 year ago

Yes, please implement auto open advanced dialog on torrent adding / magnet link opening

journeym commented 1 year ago

I have compiled a version that does it https://drive.google.com/file/d/1iS_wZHn5EqqpPWDLEiH6vBFIfuKP-J-S/view?usp=sharing

testbughub commented 1 year ago

I have compiled a version that does it https://drive.google.com/file/d/1iS_wZHn5EqqpPWDLEiH6vBFIfuKP-J-S/view?usp=sharing

Nice! Would you mind forking this repo and commit the changes you did?
Maybe the dev could merge it, and I would also see the changes
so that I can compile a Linux version.

journeym commented 1 year ago

Just remove if from line https://github.com/tympanix/Electorrent/blob/9aa66dd7af93b41382191f2f3bc144089e4ed24c/src/scripts/controllers/torrents.ts#L115 it should look like this $scope.$on('torrents:add', function(event, item: PendingTorrentUploadItem, askUploadOptions: boolean) { $scope.pendingTorrentFiles.push(item) $scope.$apply() })

testbughub commented 1 year ago

Just remove if from line

https://github.com/tympanix/Electorrent/blob/9aa66dd7af93b41382191f2f3bc144089e4ed24c/src/scripts/controllers/torrents.ts#L115

it should look like this $scope.$on('torrents:add', function(event, item: PendingTorrentUploadItem, askUploadOptions: boolean) { $scope.pendingTorrentFiles.push(item) $scope.$apply() })

Couldn't get this to work unfortunately. It just adds it still.
Not sure why though.

journeym commented 1 year ago

You can try this version https://github.com/journeym/Electorrent

journeym commented 1 year ago

It wasn't working correctly due to different handling of magnet and torrent links, i have pushed a commit that fixes that, at least fro me on windows, it's now working (wasnt working before) https://github.com/journeym/Electorrent

testbughub commented 1 year ago

It wasn't working correctly due to different handling of magnet and torrent links, i have pushed a commit that fixes that, at least fro me on windows, it's now working (wasnt working before) https://github.com/journeym/Electorrent

I just tried it, and it works great,
except for the name of the download which just says "Download location",
but that's such a minor thing that I can't complain about it.
And I had to copy the 'package-lock.json' file from the original Electorrent to get it to compile.
Thank you so much for putting down some time to fix this!
Hopefully we'll get an 'official' patch soon, but this works great for now :smile:
Cheers!

journeym commented 1 year ago

except for the name of the download which just says "Download location",

In the list of torrents after torrent startup name is correct, in the advanced options dialog, i belive, it's not possible to retrieve name for magnet link before the actual download started. At least for me, the dialog looks the same as if i use file > Paste torrent url. Please add a screenshot.

testbughub commented 1 year ago

except for the name of the download which just says "Download location",

In the list of torrents after torrent startup name is correct, in the advanced options dialog, i belive, it's not possible to retrieve name for magnet link before the actual download started. At least for me, the dialog looks the same as if i use file > Paste torrent url. Please add a screenshot.

Yeah, it still works even though it doesn't show the torrent name. Imgur

I'm not sure how common it is, but in the magnet links I've seen,
the torrent name is in the URL.

Example;
magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c&dn=Big+Buck+Bunny&tr=udp.......

And I also got an error when trying that magnet link (from https://webtorrent.io/free-torrents), but it still works. Imgur

journeym commented 1 year ago

Yeah, it still works even though it doesn't show the torrent name. Imgur

This looks perfectly normal IMO, i have the same behavior in native client (qbittorrent web gui), when adding magnet links, practically no clients i encountered decode magnet links on the fly just to get torrent name. Regarding the error this seems to be a variable type problem, i hadn't hit this when testing, seems my magnet links were shorter. Ill check it sometime, i think....

testbughub commented 1 year ago

Yeah, it still works even though it doesn't show the torrent name. Imgur

This looks perfectly normal IMO, i have the same behavior in native client (qbittorrent web gui), when adding magnet links, practically no clients i encountered decode magnet links on the fly just to get torrent name. Regarding the error this seems to be a variable type problem, i hadn't hit this when testing, seems my magnet links were shorter. Ill check it sometime, i think....

Don't worry about it. Like I said, it works, so no need to dive any deeper :)
Thanks again!