Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'remove-slow-upload-seeds' and 'remove-fast-upload-seeds' to remove torrents with slower or faster upload speed #127

Merged
merged 4 commits into from
Jun 16, 2022

Conversation

vincent806
Copy link
Contributor

@vincent806 vincent806 commented Apr 17, 2022

Add 'remove-slow-upload-seeds' to 'action' keyword in order to remove torrents with slower upload speed.
添加'remove-slow-upload-seeds'到'action'关键字, 从而能够删除慢速上传的种子.

Example:

mytask:
  ...
  ...
  ...
  ...
  strategies:
    limit_max_torrents:
      status:
        - downloading
      maximum_number:
        limit: 30
        action: remove-slow-upload-seeds
  delete_data: true

Add 'remove-slow-upload-seeds' to 'action' keyword in order to remove torrents with slower upload speed.
添加'remove-slow-upload-seeds'到'action'关键字, 从而能够删除慢速上传的种子.

Example:
limit_max_torrents:
status:
- downloading
maximum_number:
limit: 30
action: remove-slow-upload-seeds
@vincent806 vincent806 changed the title Update sortbase.py Add 'remove-slow-upload-seeds' to remove torrents with slower upload speed Apr 17, 2022
@jerrymakesjelly
Copy link
Owner

感谢你的PR,很有用的功能,可以合并。不过在合并之前,我想请你再补充一些代码:

  1. 单元测试。请在 pytest/test_strategies/cases/ 目录下的 free_spacemaximum_numberremote_free_spaceseed_size 目录中补充单元测试代码,以测试功能是否正确。
  2. 与之对应,是否需要有 remove-fast-upload-seeds,以满足部分用户的需求?

@vincent806
Copy link
Contributor Author

感谢反馈,会跟进相关内容,估计要到本周末。

@vincent806
Copy link
Contributor Author

问一下,因为之前没用过pytest,reference data那里也要准备吗? 看了一下cases里面有提到 - Torrent - 数字,这里应该是指reference data里面的种子名对吧?

@jerrymakesjelly
Copy link
Owner

问一下,因为之前没用过pytest,reference data那里也要准备吗?

不用,种子的测试数据已经准备好了,只需根据测试数据找出会删除的种子即可。另外在这里我有个小失误,测试数据其实是在 data.json 里,reference_data.py 已经过时了,我没有及时删除。

看了一下cases里面有提到 - Torrent - 数字,这里应该是指reference data里面的种子名对吧?

对的

@vincent806
Copy link
Contributor Author

hi my apologizes.. I have forgot about this PR for quite some time. I have further added remove-fast-upload-seeds, as well as the unit test cases. Everything turns out to be good. Please review.

================================================================================ test session starts =================================================================================
platform linux -- Python 3.6.9, pytest-7.0.1, pluggy-1.0.0
rootdir: /home/vincent/autoremove-torrents
plugins: mock-3.6.1, requests-mock-1.9.3, cov-3.0.0
collected 1 item

test_strategies.py . [100%]

================================================================================= 1 passed in 3.82s ==================================================================================

@vincent806 vincent806 changed the title Add 'remove-slow-upload-seeds' to remove torrents with slower upload speed Add 'remove-slow-upload-seeds' and 'remove-fast-upload-seeds' to remove torrents with slower or faster upload speed May 18, 2022
@jerrymakesjelly jerrymakesjelly changed the base branch from master to dev June 16, 2022 15:19
@jerrymakesjelly
Copy link
Owner

LGTM. Thank you for your contribution!

@jerrymakesjelly jerrymakesjelly merged commit bc533d1 into jerrymakesjelly:dev Jun 16, 2022
@vincent806
Copy link
Contributor Author

Thanks for update. In terms of user experiences, I will further create a PR to cover 'remove-fast-download-seeds' and 'remove-slow-download-seeds'. Stay tuned.

@jerrymakesjelly
Copy link
Owner

Good. Looking forward for to your new PR. 😄

@jerrymakesjelly jerrymakesjelly mentioned this pull request Jun 19, 2022
@vincent806
Copy link
Contributor Author

新功能
在 action 关键字中添加了 remove-slow-upload-seeds 和 remove-fast-upload-seeds 两个动作。 (#127) 感谢 @vincent906

I'm afraid there is typo here... 906 --> 806

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants