Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Display external address #20118
base: master
Are you sure you want to change the base?
Display external address #20118
Changes from 7 commits
a398dc4
2323e9a
c6cd439
d5888aa
4e07c0a
91d075a
37a9eda
7ae5783
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't look like you need to remove the
const
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I added that back with the latest commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about changing "Detecting" to "N/A"?
Not all users have such large monitors as you, and among those who do, not all have the desire to stretch the qBittorrent window to the full screen and shake their heads left and right to view it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, the IP address will still be longer. But in any case, all we can say about this is that the information about external address is currently "not available". IMO, "Detecting" looks speculative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how that would differentiate between "Not available...yet" and other states such as failed, but I do agree about 'Detecting' sounding speculative. Perhaps more information should be communicated to the frontend from the means that qBittorrent uses to detect. "Detecting/Detection failed" etc? As for how much space is used...at this rate it's looking like you want just external addresses printed and nothing else which, quite frankly, leaves me baffled as to what the information would be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then again, some people use torrent clients on closed networks (so local IP address(es)), so maybe it can make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong order, keys are sorted alphabetically here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... I didn't see anything that required it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the previous conventions used by qBittorrent for other variables used similarly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although unlikely, I would still suggest using other character for replacement specifier. Maybe
$1
,$2
See: https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses_(with_zone_index)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't think any device was allowed to start with a number, so I didn't think there any chance of running into %[0-9] with %[0-9] being some interface. I could be wrong but I thought no device could start with [0-9].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, according to the linked article, Windows will use %[0-9] format:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the WebUI, I believe it should work to do this in reverse-order. Ex:
$('externalAddresses').set('html', last_external_addresses.replace("%2", last_external_address_v6).replace("%1", last_external_address_v4));
Similarly I think the GUI should do the same (reverse order) and always specifically replace the first occurrence only. Edit: I'm away from rig for the day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to ask, does qB supply those interfacings or does qB just supply the IP address? If it's IP address then we don't need to account for which interface (unless interface is added to IP addresses). My only test case for this info has been Linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must've been thinking about another client then. Still, there isn't any way for a peer or tracker to know which interface the client is using, so the entire point seems moot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't know much about IPv6. What exactly are you talking about when you mention the interface? About the zone identifier, e.g.
%eth0
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhere on this long thread someone mentioned something about not using
%
in Qt API calls because the IPv6 address might have the zone identifier reported and it'd break it but they're assuming that qBittorrent includes that information...when it gets that address from a remote server (peer/tracker/site). The remote endpoint wouldn't have a clue about which interface qBittorrent is using and won't report that. Edit: There was also suggestion around modifying the JavaScript implementation of that string, I can't remember what it was. I've got too much to do and qBittorrent isn't a high priority. The initial src offering was fine but there's no way to please everyone, so I've stuck to my ViolentMonkey script which does exactly what I want.Edit: Too long a thread, unable to search and follow it anymore hardly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, Zone ID is "locally significant" (enables us to define out which interface we want to send some traffic) and there is no point to send it to remote host as part if its "external address". But we still can't be sure that it isn't sent in such a way (with Zone ID) so the question is how is it handled by libtorrent, i.e. can it provide we "external address" that mistakenly contains such Zone ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Someone familiar with libtorrent's API should weigh in. I resorted to a VM script, so I'm fine and qBittorrent can do with this PR as they want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy paste error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. -_-; Too tired to address right now, will do later.