-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Handle .txt URL in tracker list #20115
base: master
Are you sure you want to change the base?
Conversation
src/base/bittorrent/sessionimpl.cpp
Outdated
@@ -73,6 +73,9 @@ | |||
#include <QThreadPool> | |||
#include <QTimer> | |||
#include <QUuid> | |||
#include <QNetworkAccessManager> |
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.
QNetworkAccessManager
isn't intended to be used directly in qBittorrent. Net::DownloadManager
component should be used instead.
src/base/bittorrent/sessionimpl.cpp
Outdated
reply->deleteLater(); | ||
}); | ||
|
||
// Wait for the reply to finish |
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 seem like a good idea.
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.
May I ask you why do you think it's bad? I've used this technique already in other cases and it seemed to work good without memory leaks, but I'm actually not ax expert in Qt development, if there's a better way I'm curios to learn.
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.
Creating a local event loop inside another one makes the flow of the program even more confusing, while making a false impression of its straightforwardness, which can lead to difficult-to-diagnose errors. After encountering such errors a couple of times, we preferred to get rid of such local event loops (although we never created them directly, but there are some Qt functions doing this behind the scene, e.g. Dialog::exec
).
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.
That makes sense. Okay I'll try to refactor this code.
Personally I dislike to mix it into regular additional trackers list. IMO, it should be separated from manually specified trackers list. |
Yeah I imagined that, this is the reason I was skeptical of making a pull request. I'll try to extend the interface so that it'll have two tracker list. |
fe41bff
to
1dec48c
Compare
Today I had some free time and I tried to implement the feature by extracting it from the enhanced edition. |
This comment was marked as resolved.
This comment was marked as resolved.
If you change the link and click "refresh" trackers are not refreshed the first time. But so it works well, nothing else found. |
src/base/bittorrent/sessionimpl.cpp
Outdated
void SessionImpl::updatePublicTracker() | ||
{ | ||
Preferences *const pref = Preferences::instance(); | ||
Net::DownloadManager::instance()->download(Net::DownloadRequest(pref->customizeTrackersListUrl()).userAgent(QStringLiteral("qBittorrent Enhanced/" QBT_VERSION_2)), Preferences::instance()->useProxyForGeneralPurposes(), this, &SessionImpl::handlePublicTrackerTxtDownloadFinished); |
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.
You forgot to change User-Agent :|
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.
Fixed
Yep I noticed that too, and I can reproduce the same bug with the Enhanced Edition. I'll try to investigate it. |
@JackHack96 any progress? (btw, thanks for working on this!) |
Unfortunately no, I tried to debug the refresh button problem some weeks ago but without any results. |
This commit adds the ability to parse .txt URL in the automatic tracker add list, as requested by qbittorrent#6865
This commit adds an option for automatic tracker population and update, taken from qBittorrent Enhanced Edition. This commit fulfill the request qbittorrent#6865.
This commit fix the User Agent used when setting the public tracker URL. It also simplifies two switch cases as indicated by the GitHub code scanner bot.
This commit fix the behaviour of the fetch button for automatic tracker population.
I've managed to fix the behavior of the fetch button, so now the patch should be ready. Though I suggest at this point to change the name of the pull request to something like: "Handle automatic tracker fetch from URL", to suggest the fact that it only supports one URL at a time. |
This comment was marked as resolved.
This comment was marked as resolved.
Was testing an older version by mistake, 2024-04-08.20-12-25.mp4 |
This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity. |
@JackHack96, any progress on that? |
Nope sorry, I didn't work on the project since the last bug report. |
This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity. |
@JackHack96, any news? |
This commit adds the ability to parse .txt URL in the automatic tracker add list, as requested by #6865