openscopeproject / TrguiNG

Remote GUI for Transmission torrent daemon
GNU Affero General Public License v3.0
278 stars 33 forks source link

Get rid of infinity sign in U/D #137

Closed Dukobpa3 closed 6 months ago

Dukobpa3 commented 6 months ago

I've just made this PR but then figured out that we don't need the infinity sign at all. We can see not loaded torrents by many others marks like empty bar or status icon

https://github.com/openscopeproject/TrguiNG/pull/135

Maybe not merge it for now because I trying to understand how to provide custom sorting for columns with accessorFn. Most of them sorting in some unpredictable way

Could you help with some manuals? I'm not coding ts at all, just raw js a little. My main langs is java/c#.

qu1ck commented 6 months ago

What is displayed in the field has no effect on how it is sorted if it has accessorFn. Only the value that the accessor returns affects the sorting order. For infinity case the accessor likely returns NaN which javascript sorts however it sorts, if you want to change sorting order you need to take care of 0 download case separately. That said, you can't just remove infinity without replacement and I doubt there is a better one.

Dukobpa3 commented 6 months ago

So with sorting I think the issue is that All accessorFn's returns <div></div> For U/D I've just made custom one sorting.

Dukobpa3 commented 6 months ago

I've removed inifinity just because of cleaner look and code)) Not because of sorting

Dukobpa3 commented 6 months ago

@qu1ck I've fixed sorting. So if U ok with it – ready to merge

qu1ck commented 6 months ago

Sorting fix looks good, but keep the infinity.

Dukobpa3 commented 6 months ago

Done

Dukobpa3 commented 6 months ago

Wait then

I'l play with it a little

Wanna get proper sorting between inf and zero

qu1ck commented 6 months ago

I fixed it so infinity is not below zero in sorting and 0 upload always shows "-". Thanks for contributing!

Dukobpa3 commented 6 months ago

And as result you've made only dashes)) We will never see infinity now. I like it (:

qu1ck commented 6 months ago

Infinity is still shown when upload is > 0 and download is 0, as was intended. That is the case when you are seeding data that you already had, for example uploading your own torrent.

Dukobpa3 commented 6 months ago

Sorting still not perfect but I think there is enough time wasted already))