aria2p icon indicating copy to clipboard operation
aria2p copied to clipboard

Ratio and seed_time

Open anasty17 opened this issue 2 years ago • 15 comments

Hi, hope you doing well

Can you add seed_ratio and seed_time in download class. So we can view how much this torrent has seed time and seed ratio.

Thanks

anasty17 avatar Aug 04 '22 15:08 anasty17

Hello, I'm doing OK, thank you :slightly_smiling_face: Could you give an example of what seed ratio and seed time should look like? Or describe them? Can they be computed from the already available fields? If yes, do you happen to know the computation? We can definitely add properties to the Download class.

pawamoy avatar Aug 17 '22 19:08 pawamoy

Download.seed_ratio will return self.upload_length / self.completed_length

Seed time: On bt_download_complete or when Download.seeder is True we should save the start_time Then Download.seed_time will return time() - self.seed_start_time

anasty17 avatar Aug 17 '22 20:08 anasty17

That's great, thanks a lot! I'll see if I can incorporate this in the code soon :slightly_smiling_face: A PR is also welcome of course :smile:

pawamoy avatar Aug 17 '22 20:08 pawamoy

Yeah i will try to read how ur code works, if it's simple and direct then i will open PR. Thanks

anasty17 avatar Aug 17 '22 20:08 anasty17

I was reading now. I have no idea how to save the start time for seed after on_bt_download_complete in efficient way. This the only problem, the rest is very simple.

anasty17 avatar Aug 17 '22 22:08 anasty17

Just so you know, I've seen your last comment but didn't get the chance to answer yet. I'll keep this closed because if aria2 doesn't provide start time, it will be hard to provide it ourselves, but I'd still like to think about it a bit :)

pawamoy avatar Aug 26 '22 19:08 pawamoy

It's ok 👍

anasty17 avatar Aug 26 '22 20:08 anasty17

Hello,

I think seed ratio should be added, aria2c reports it while seeding a torrent

iambeingtracked avatar Feb 18 '23 15:02 iambeingtracked

Hi @iambeingtracked, would you to send a PR for it? It's a pretty easy addition :slightly_smiling_face:

pawamoy avatar Feb 18 '23 16:02 pawamoy

Hello,

I think seed ratio should be added, aria2c reports it while seeding a torrent

Yeqh seed ratio is easy to add but seed time need to save onComplete time and save it with gid

anasty17 avatar Feb 18 '23 18:02 anasty17

Seed time will be much more complicated indeed. It can be done in another PR if someone wants to try and tackle it.

pawamoy avatar Feb 18 '23 18:02 pawamoy

It can be done. Add global dict key: gid, value: complete_time when download complete if not metadata. And if torrent removed check if gid in dict and remove it. But this also need to use threading.Lock with it.

anasty17 avatar Feb 18 '23 18:02 anasty17

Hi there, any progress on this thread?

Lyken17 avatar Nov 28 '23 04:11 Lyken17

It's in my saved notifications. Pull requests are welcome :slightly_smiling_face:

pawamoy avatar Nov 28 '23 07:11 pawamoy

Maybe in couples of days When i get some free time, I will add them for api

anasty17 avatar Nov 30 '23 19:11 anasty17