#2848: Incorrect share ratio in torrent status
-------------------------+-------------------------------------------------
  Reporter:  ph33onix    |      Owner:
      Type:  bug         |     Status:  new
  Priority:  minor       |  Milestone:  2.0
 Component:  Core        |    Version:  1.3.6
Resolution:              |   Keywords:  share ratio total_done
                         |  all_time_download
-------------------------+-------------------------------------------------
Description changed by Cas:

Old description:

> In /deluge/core/torrent.py, the get_ratio method always uses the
> total_done variable even though it has an all_time_download variable
> available. Wouldn't it be best to use whichever is greater between
> total_done and all_time_download to get the lowest (and safest) ratio?
>
> So:
> If the download is new then total_done and all_time_download will be
> about the same.
> If the download is new but some files have already been downloaded then
> total_done will be used as it will be bigger than all_time_download.
> If the download is old and we deselect some files(set to not download)
> and also delete them then all_time_download will be used as it will be
> (much) bigger than total_done. This is the main improvement.
>
> The only problem case is if someone manually adds files to an old
> torrent. If the added files bump total_done over all_time_download which
> means behaviour is the same as before. If the added files don't bump
> total_done over all_time_download then all_time_download is used which is
> a bigger number and results in a lower ratio which is closer to the
> truth. So while this change doesn't fix this case it still improves it.
>
> Is there anything I'm missing ?

New description:

 In `/deluge/core/torrent.py`, the `get_ratio` method always uses the
 `total_done` variable even though it has an `all_time_download` variable
 available.

 Wouldn't it be best to use whichever is greater between `total_done` and
 `all_time_download` to get the lowest (and safest) ratio?

 So:

  - If the download is new then `total_done` and `all_time_download` will
 be about the same.
  - If the download is new but some files have already been downloaded then
 total_done will be used as it will be bigger than `all_time_download`.
  - If the download is old and we deselect some files(set to not download)
 and also delete them then `all_time_download` will be used as it will be
 (much) bigger than `total_done`. This is the main improvement.

 The only problem case is if someone manually adds files to an old torrent.
 If the added files bump `total_done` over `all_time_download` which means
 behaviour is the same as before. If the added files don't bump
 `total_done` over `all_time_download` then `all_time_download` is used
 which is a bigger number and results in a lower ratio which is closer to
 the truth. So while this change doesn't fix this case it still improves
 it.

 Is there anything I'm missing ?

--

--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2848#comment:2>
Deluge <http://deluge-torrent.org/>
Deluge Project

-- 
You received this message because you are subscribed to the Google Groups 
"Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to