Changes between Initial Version and Version 2 of Ticket #2848


Ignore:
Timestamp:
03/31/2017 10:24:45 AM (7 years ago)
Author:
Cas
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2848

    • Property Milestone changed from 1.3.x to 2.0
  • Ticket #2848 – Description

    initial v2  
    1 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? 
     1In `/deluge/core/torrent.py`, the `get_ratio` method always uses the `total_done` variable even though it has an `all_time_download` variable available. 
     2 
     3Wouldn't it be best to use whichever is greater between `total_done` and `all_time_download` to get the lowest (and safest) ratio? 
    24 
    35So: 
    4 If the download is new then total_done and all_time_download will be about the same. 
    5 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. 
    6 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. 
    76 
    8 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. 
     7 - If the download is new then `total_done` and `all_time_download` will be about the same. 
     8 - 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`. 
     9 - 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. 
     10 
     11The 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. 
    912 
    1013Is there anything I'm missing ?