You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on improving the priority_thread.py code, so that when selecting "Select priority of first un-downloaded piece to High" 2,5% of the first un-downloaded pieces are set to Highest, 2,5% of the next un-downloaded pieces are set to Higher and 2,5% of the next un-downloaded pieces after that is set to High.
That way any torrent will stream very efficiently. Because just setting High priority on 1 single piece doesn't work well, as is the default in the current code.
But I am unable to change the priority of an amount of pieces relative to the total amount of pieces in the torrent. So currently I have a set amount of pieces that is changed.
Which doesn't work so well when the torrent either have very few or very many of pieces.
Here is what I have done so far.
I have changed this:
__target_priority = 5
(...)
# lf is now the first un-downloaded, desired piece of this torrent
if (tor.handle.piece_priority(lf) < __target_priority):
tor.handle.piece_priority(lf,__target_priority)
__last_first[t] = lf
into this:
__target_priority = 7
__target_priority2 = 5
__target_priority3 = 2
(...)
# lf is now the first un-downloaded, desired piece of this torrent
if (tor.handle.piece_priority(lf) < __target_priority):
for e in range(0, 25):
tor.handle.piece_priority(lf+e,__target_priority)
for e2 in range(25, 51):
tor.handle.piece_priority(lf+e2,__target_priority2)
for e3 in range(51, 77):
tor.handle.piece_priority(lf+e3,__target_priority3)
__last_first[t] = lf
What is the variable for the total amount of pieces, so that I can dynamically calculate the ranges of the for loops?
The text was updated successfully, but these errors were encountered:
I am working on improving the priority_thread.py code, so that when selecting "Select priority of first un-downloaded piece to High" 2,5% of the first un-downloaded pieces are set to Highest, 2,5% of the next un-downloaded pieces are set to Higher and 2,5% of the next un-downloaded pieces after that is set to High.
That way any torrent will stream very efficiently. Because just setting High priority on 1 single piece doesn't work well, as is the default in the current code.
But I am unable to change the priority of an amount of pieces relative to the total amount of pieces in the torrent. So currently I have a set amount of pieces that is changed.
Which doesn't work so well when the torrent either have very few or very many of pieces.
Here is what I have done so far.
I have changed this:
into this:
What is the variable for the total amount of pieces, so that I can dynamically calculate the ranges of the for loops?
The text was updated successfully, but these errors were encountered: