pawamoy / aria2p

Command-line tool and library to interact with an aria2c daemon process with JSON-RPC.
https://pawamoy.github.io/aria2p
ISC License
490 stars 93 forks source link

Ratio and seed_time #116

Open anasty17 opened 2 years ago

anasty17 commented 2 years ago

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

Boost priority

Fund with Polar

pawamoy commented 2 years ago

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.

anasty17 commented 2 years ago

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

pawamoy commented 2 years ago

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:

anasty17 commented 2 years ago

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

anasty17 commented 2 years ago

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.

pawamoy commented 2 years ago

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 :)

anasty17 commented 2 years ago

It's ok 👍

iambeingtracked commented 1 year ago

Hello,

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

pawamoy commented 1 year ago

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

anasty17 commented 1 year ago

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

pawamoy commented 1 year ago

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

anasty17 commented 1 year ago

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.

Lyken17 commented 11 months ago

Hi there, any progress on this thread?

pawamoy commented 11 months ago

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

anasty17 commented 11 months ago

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