lighterowl / transgui

A fork of Transmission Remote GUI
GNU General Public License v2.0
152 stars 4 forks source link

Feature: Pieces Bar for availability and each file #33

Open lighterowl opened 1 year ago

lighterowl commented 1 year ago

https://github.com/transmission-remote-gui/transgui/issues/1454

I like the idea, sounds cool and will be interesting to see how the code drawing the main piece bar does it and whether it's reusable in the VarGrid used for files.

lighterowl commented 1 year ago

Sadly, this cannot be done without extra work in Transmission itself as there is no information about piece-to-file mapping exposed via the RPC. The daemon must know this because it must be able to map incoming pieces into corresponding files, so this is "just" a matter of exposing this mapping.

lighterowl commented 1 year ago

PR submitted in Transmission : https://github.com/transmission/transmission/pull/5578

dechamps commented 2 months ago

Sadly, this cannot be done without extra work in Transmission itself as there is no information about piece-to-file mapping exposed via the RPC.

As discussed in transmission/transmission#5578, the piece-to-file mapping can be deduced directly from the ordered list of files, their lengths and the piece size, all of which are already available via RPC. There is no need to extend the Transmission RPC interface. In fact it would probably make more sense for your software to manually compute the mapping despite the new fields, because that way it would work even with older Transmission versions.

lighterowl commented 2 months ago

Agreed - beginPiece and endPiece should be treated as a failed experiment at this point. The linked ticket contains a procedure that can be used for calculating the piece numbers that a given file spans.