jesec / flood

A modern web UI for various torrent clients with a Node.js backend and React frontend.
https://flood.js.org
GNU General Public License v3.0
2.08k stars 127 forks source link

transmission: -1 ratio on seeding torrents with 0B downloaded #720

Open antifuchs opened 4 months ago

antifuchs commented 4 months ago

Type: Bug Report

Your Environment

Summary

I'm not sure why the transmission API does this, but on occasion some seeding torrents will show 0 bytes downloaded; that causes flood to display the up/download ratio as -1.

Expected Behavior

On torrents that were downloaded from elsewhere, it would be great if the ratio could be correctly computed, instead of punting on the computation. The transmission API reports an uploadRatio field (in the RPC spec for torrent-get), and it tends to be correct. Maybe flood can use that?

If that's not usable, I would suggest using the totalSize field as the divisor instead of downloadedEver (as total size tends to not be zero).

Current Behavior

Currently, it looks like flood is dividing the amount of data uploaded (uploadedEver) by the amount of data downloaded (downloadedEver). If the divisor should be zero, that results in a not-a-number result, which I assume flood translates into -1.

I imagine it is reasonable for torrents that this instance started seeding, but transmission also reports 0B total downloaded on torrents that it downloaded from somewhere else (again, not sure why).

Possible Solution

Several options:

Steps to Reproduce

I could not find a common pattern for when the transmission API reports useless field values (it has similar issues with the "date finished" field on occasion), sorry /:

Context

trim21 commented 2 months ago

how you define "correct" share ratio if you didn't download anything...

antifuchs commented 2 months ago

Please notice that the issue description is attempting to define exactly that for the case I am reporting. The data being seeded was downloaded (torrent didn't start out seeding), only the transmission API isn't reporting the data downloaded under the field that flood expects.

trim21 commented 2 months ago

I'm getting confused.

On torrents that were downloaded from elsewhere,

do you mean, other bt client? so transmission doesn't track downloading

trim21 commented 2 months ago

What if I create a torrent and seeding it? You can't tell the difference from api.

But I can get your point

pull request welcome. we could change this to uploaded/totalSize, this make more sense.