Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .desktop file configured for torrents #100

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kpcyrd
Copy link
Contributor

@kpcyrd kpcyrd commented Mar 28, 2024

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.

@ikatson
Copy link
Owner

ikatson commented Mar 28, 2024

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?

@kpcyrd
Copy link
Contributor Author

kpcyrd commented Mar 28, 2024

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

@ikatson
Copy link
Owner

ikatson commented Mar 28, 2024

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
Copy link
Owner

ikatson commented Mar 28, 2024

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

@ikatson
Copy link
Owner

ikatson commented Mar 28, 2024

The HTTP API client is in librqbit::http_api_client btw

@ikatson
Copy link
Owner

ikatson commented Mar 28, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants