-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Provide torrent creation feature via WebAPI #20366
Conversation
1503c3f
to
31d8be3
Compare
31d8be3
to
cf477bb
Compare
const QList<std::shared_ptr<BitTorrent::TorrentCreationTask>> tasks = id.isEmpty() | ||
? m_torrentCreationManager->tasks() | ||
: QList<std::shared_ptr<BitTorrent::TorrentCreationTask>> {singleTask}; | ||
QJsonArray statusArray; |
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.
Wouldn't it be better to return them as a map (JSON object) with task IDs as keys?
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.
Wouldn't it be better to return them as a map (JSON object) with task IDs as keys?
@rcarpa
What do you think about this?
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 did some manual testing. Everything seems to work correctly.
0821418
to
1e6c25e
Compare
@qbittorrent/bug-handlers |
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.
last few comments
1e6c25e
to
03a2773
Compare
.trackers = params()[KEY_TRACKERS].split(u'|'), | ||
.urlSeeds = params()[KEY_URL_SEEDS].split(u'|') |
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.
@glassez FYI it appears this new API endpoint is also using a pipe to delimit URLs. This might be worth changing before 5.0 ships.
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.
@glassez FYI it appears this new API endpoint is also using a pipe to delimit URLs. This might be worth changing before 5.0 ships.
I've been thinking about this problem. Honestly, it doesn't occur to me what other character could be used instead of |
to avoid this problem. It seems to me that this is impossible to find one. Whichever character we use, it may be inside one of the URLs of the list.
Maybe it would make sense to percent encode each URL before combining it into an array when sending, and first split the array and then percent decode each URL when receiving?
Closes #5614.
Based on original PR #19498.