This fixes #16 and also generally improves how Categories function across the app. I've eliminated the separate arrays for category names and save paths, and simplified the completion handlers to always sort remote categories before appending them to the array.
There are more optimizations that should be done here (possibly a CategoryManager to avoid refetching categories so frequently?) but for now this change should prevent any weirdness from the qBittorrent JSON response.
Tests:
Added a new torrent and verified that categories download regardless of download_path being set to No. Categories display sorted in filter view and in torrent details view. Changing the category updates the category in qBittorrent in real time.
Note: this PR depends on #15 so ignore the older commit in this PR, as ideally that one should be merged first.
This fixes #16 and also generally improves how Categories function across the app. I've eliminated the separate arrays for category names and save paths, and simplified the completion handlers to always sort remote categories before appending them to the array.
There are more optimizations that should be done here (possibly a CategoryManager to avoid refetching categories so frequently?) but for now this change should prevent any weirdness from the qBittorrent JSON response.
Tests: Added a new torrent and verified that categories download regardless of
download_path
being set to No. Categories display sorted in filter view and in torrent details view. Changing the category updates the category in qBittorrent in real time.Note: this PR depends on #15 so ignore the older commit in this PR, as ideally that one should be merged first.