Skip to content
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

Queue column doesn't handle zero-based numbering (transmission client) #193

Closed
1 of 5 tasks
13k opened this issue Oct 27, 2020 · 2 comments
Closed
1 of 5 tasks

Queue column doesn't handle zero-based numbering (transmission client) #193

13k opened this issue Oct 27, 2020 · 2 comments

Comments

@13k
Copy link

13k commented Oct 27, 2020

Client:

  • µTorrent
  • qBittorrent
  • Transmission
  • rTorrent
  • Deluge

Client Version: 3.00 (bb6b5a062e)

Operating System: Windows

Application Version: 2.7.1

Description:

Looks like the queue implementation doesn't account for zero-based numbering, either when sorting or displaying values.

The transmission RPC protocol specification states that the queue position value starts at zero.

Sorting

The sorting implementation seems to always push the zero value queue position to last.

(Side note on the function naming: I thought the natural numbers set included zero?)

Manual sorting test in node console:

> function sorter(a, b){
... if (a < 1) return 1
...         if (b < 1) return -1
...         return a - b
...     }
undefined
> arr=[1,5,8,0,6,4,9,3]
[
  1, 5, 8, 0,
  6, 4, 9, 3
]
> arr.sort(sorter)
[
  1, 3, 4, 5,
  6, 8, 9, 0
]

Display

The queue column's render template seems to ignore the zero value, probably because javascript treats zero as a false-y value, falling back to torrentQueue and it seems this scope var is undefined.

Screenshot

Below is the queue column in the Electorrent app. The purple arrow indicates a torrent that has a position 0 in the queue.

20201027-181926-firefox

This one is from tremotesf2 app. The purple arrow indicates the same torrent.

20201027-185741-tremotesf

@tympanix
Copy link
Owner

Excellent documentation on this bug. Sorry I didn't get to fix this sooner.

@13k
Copy link
Author

13k commented Dec 12, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants