johman10 / flood-for-transmission

A Flood (https://github.com/Flood-UI/flood) clone for Transmission
GNU General Public License v3.0
353 stars 33 forks source link

Fix file selector in torrent details #584

Closed Astalfr closed 1 week ago

Astalfr commented 2 months ago

This PR aims to fix the issue described in https://github.com/johman10/flood-for-transmission/issues/575.

Sorting the file list before creating the folder structure could cause the file indices to be incorrect, leading to problems such as not downloading the correct file or folder.

I tested it with a torrent where I encountered this problem and it seems to work properly with this patch.

johman10 commented 1 week ago

@Astalfr, thanks a lot for creating a PR. This helped me to further debug the issue you linked. I landed on a slightly different solution which involves adding the index to the file object earlier and then only depending on that to ensure we always "talk" about the right file.

I hope this makes sense, but feel free to ask questions or raise concerns. At least with my testing this solved the issue.