rqbit icon indicating copy to clipboard operation
rqbit copied to clipboard

Add .desktop file configured for torrents

Open kpcyrd opened this issue 10 months ago • 6 comments

The tauri generated .desktop file is not configured for any file types or protocols, with this file rqbit-desktop is going to be suggested for opening magnet links and .torrent files.

However, I noticed commandline arguments are currently not understood by rqbit-desktop, and opening two files results in two rqbit-desktop instances.

kpcyrd avatar Mar 28 '24 16:03 kpcyrd

Isn't it useless without rqbit-desktop understanding command line arguments? It will ignore the file you're trying to open anyway, won't it?

ikatson avatar Mar 28 '24 16:03 ikatson

True, I should probably look into how to accept command-line arguments as part of this PR. To you have any pointers?

kpcyrd avatar Mar 28 '24 17:03 kpcyrd

Just accepting isn't enough, you need to do smth with them, which isn't very trivial either:

  • if it's not open yet, you need to start with the torrent that was passed in
  • if it's already open (how to determine that?), you need to tell it somehow what to download

An ugly hack would be to assume that TCP API is on, in which case you can use that to

  • test if it's running alreay or not
  • submit a file for download

So if you are ready to tackle this, then this is the file to add this to (including parsing command line args): https://github.com/ikatson/rqbit/blob/main/desktop/src-tauri/src/main.rs

ikatson avatar Mar 28 '24 17:03 ikatson

Also if an existing window is there would be cool to focus on it

ikatson avatar Mar 28 '24 17:03 ikatson

The HTTP API client is in librqbit::http_api_client btw

ikatson avatar Mar 28 '24 17:03 ikatson

Actually, thinking more about it, it's not enough - you don't want to simply add the file! You want instead of open the dialog in the UI - the one that is opened when you click the UI buttons to add magnet or local file. Which makes it not possible to do via existing HTTP API

ikatson avatar Mar 28 '24 17:03 ikatson