Open AbeniMatteo opened 3 years ago
@glassez Do you think this is a libtorrent bug? if it is not then qbt needs additional workaround for it.
I don't think so, libtorrent already has a method to merge multiple operations (see https://github.com/arvidn/libtorrent/pull/4151/files). But it only works if you request the update of specific files, qBittorrent is requesting the update of all the files and the last batch wins.
@AbeniMatteo is this still an issue ?
Bug report
Checklist
Description
qBittorrent info
What is the problem
Calling
filePrio
WebAPI endpoint multiple times before the previous operation is completed overrides the previous changes.Causes:
prioritize_files
is asyncfilePrio
respond200 OK
without waiting the priorities to be updatedfilePrio
retrieves the possibly not-yet-updated priorities of each file, updates the specified files and sends the entire batch to libtorrentDetailed steps to reproduce the problem
(A0, B0)
..../filePrio?hash=abc&id=0&priority=1
and wait for response. Internally reads (A0, B0) and writes (A1, B0)..../filePrio?hash=abc&id=1&priority=1
and wait for response. Internally reads (A0, B0) !!wrong!! and writes (A0, B1).