Skip to content

Commit

Permalink
release: version 1.5.4
Browse files Browse the repository at this point in the history
Merge pull request #138 from jerrymakesjelly/dev
  • Loading branch information
jerrymakesjelly committed Jun 19, 2022
2 parents 2d39a63 + acc1982 commit 674e71f
Show file tree
Hide file tree
Showing 67 changed files with 1,929 additions and 765 deletions.
151 changes: 23 additions & 128 deletions README-cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,146 +107,41 @@
-----------
|Screenshot|

.. |Screenshot| image:: https://user-images.githubusercontent.com/6760674/40576720-a78097fe-612d-11e8-9dda-8aac0c5011a2.png
.. |Screenshot| image:: https://user-images.githubusercontent.com/6760674/174464634-15743d59-f1dc-41c9-bff6-6d90becaeb67.gif

更新日志
----------
**2020-08-27 周四**:1.5.3 版本
**2022-06-19 星期日**:版本 1.5.4

* 修复 psutil 在群晖的兼容问题(用于检查磁盘剩余空间)。(#61)
* 可以通过 ``--debug`` 或 ``-d`` 命令行启用调试模式。(#76)
* 修复由主机 URL 末尾的 ``/`` 导致的 API 不兼容的问题。(#81)
* 添加上传量与下载量两个条件。(#79)
变动
+++++

**2020-03-27 周五**:1.5.2 版本。
* 移除端口开放状态(Outgoing Port Status)的信息。(#101) (#135)
- 我们确认了一个 bug,即,当我们使用 Transmission 并在 IPv6 网络下检查端口开放状态时,Transmission 的端口检查器会报错并提示“portTested: http error 400: Bad Request”。
- 由于没有删种条件需要依赖这个端口开放状态,所以我们删了它。

* 支持 Deluge (#8);
* 使用批量删除提升删除效率;
* 修复配置文件中的多语言支持问题(#69);
* 客户端名称不再对大小写敏感。
* 修改了 ``last_activity`` 的行为。(#93) (#98) (#109)
- 默认情况下,``last_activity`` 不再删除那些从未活跃过的种子。
- 在需要的情况下,这些从未活跃过的种子可以用以下的方式去删除:
+ 对于 ``last_activity`` 条件,使用 ``last_activity: never`` 或者 ``last_activity: none``。
+ 对于 ``remove`` 表达式,使用 ``last_activity = never`` 或者 ``last_activity = none``。

**2020-02-29 周六**:1.5.1 版本。
新功能
++++++

* 修复了 1.5.0 版本中丢失的状态 ``StalledUpload`` 和 ``StalledDownload``。(#66)
* 在 ``action`` 关键字中添加了 ``remove-slow-upload-seeds`` 和 ``remove-fast-upload-seeds`` 两个动作。 (#127) 感谢 @vincent906!
* remove 表达式中支持等号(``=``)。
* 添加 ``downloading_time`` 条件。 (#88) 感谢 @dantebarba!

**2020-02-28 周五**:1.5.0 版本。
修复
+++++

* 修复了无法登录使用纯数字用户名或密码的客户端的问题(#64);
* 修复了在没有标签属性的 Transmission 中任务无法执行的问题;
* 修复了删种条件可能对未打标签以及没有Tracker的种子无效的问题;
* 修复了 status 中遗漏的 μTorrent 状态“排队中”(``Queued``);
* ``status`` 中添加 ``Error`` 状态;
* 添加对 Transmission 标签的支持(#24);
* 添加删除条件“最大下载速度” ``max_downloadspeed``、“最小上传速度” ``min_uploadspeed``;
* 添加删除条件“最小平均上传速度” ``min_average_uploadspeed``、“最大平均下载速度” ``max_average_downloadspeed`` (#49);
* 添加删除条件“最大种子大小” ``max_size`` (#21);
* 添加删除条件“最大做种数” ``max_seeder``、“最小下载数” ``min_leecher`` (#62);
* 添加删除条件“最大已连接做种者” ``max_connected_seeder``、“最小已连接下载者” ``min_connected_leecher``;
* 添加删除条件“最后活动时间” ``last_activity``,以删除一段时间内没有上传或下载速度的种子(#1)(#9);
* 添加删除条件“最大下载百分比” ``max_progress``;
* ``free_space``、``maximum_number``、``seed_size`` 的 ``action`` 中添加 ``remove-active-seeds``、``remove-inactive-seeds`` 动作,用于根据最后活动时间去尽量删除活跃的种子或者不活跃的种子(#9);
* 添加了新的删除条件“上传比率” ``upload_ratio``,可以根据上传量占种子大小的比例删种(#55);
* 修复了上传/下载量以及 ``free_space``、``remote_free_space`` 不能正确处理小数的问题。 (#133) 感谢 @sfwn!
* 修复了 ``last_activity`` 条件在 Deluge 2.0.3 及以上版本无效的问题。(#119)

**2020-02-03 周一**:迁移文档到 Read the Docs。
`更多更新日志`_

**2020-01-26 周日**: 1.4.9 版本。

* 添加了 `free_space` 条件(最小剩余空间)。

**2020-01-07 周二**: 1.4.8 版本。

* 修复了在 qBittorrent v4.2.1 中不能删除种子的问题。对造成的不便深感抱歉。 (#53)

**2020-01-06 周一**: 1.4.7 版本。

* 添加了 qBittorrent v4.2.1 中新 API 的支持。 (#46) **注意:这个版本有bug,请升级到1.4.8或者更高的版本。**

**2019-09-17 周二**: 1.4.6 版本。

* 修复了当 Tracker 的 URL 包含端口时,`tracker` 过滤器需要指定端口的问题。

**2019-06-06 周四**: 1.4.5 版本。

* 添加了 `StalledUpload` 与 `StalledDownload` 状态。

**2019-05-22 周三**: 1.4.4 版本。

* 修复了当 `seed_size` / `maximum_number` 条件与 `ratio` / `create_time` / `seeding_time` 条件同时使用时任务会失败的问题。(#33)
* 新特性:如果过滤器的内容只有一行,现在可以直接写出而不需要使用列表。

**2019-05-19 周日**: 1.4.3 版本。

* 添加对 Python 2.7 的支持。(#29)
* 停止支持 Python 3.4。(kennethreitz/requests#5092)

**2019-05-13 周一**: 1.4.2 版本。

* 修复了丢失的语法分析器文件。(#32)
* 修复了运算符的结合性。现在,运算符 `and` 和 `or` 保证是左结合的。(#32)

**2019-05-06 周一**: 1.4.1 版本。

* 修复了丢失的依赖项 `ply`。
* 修复了在`remove`条件中重复定义的警告。

**2019-05-06 周一**: 更新了文档。

* 增加了关于`remove`条件的描述。

**2019-05-01 周三**: 1.4.0 版本。

* 删除了 ``seeding_time`` 和 ``ratio`` 条件中的限制 (#19)。
- 在之前的版本,``seeding_time`` 和 ``ratio`` 条件只会删除那些正在做种的种子。设置这个限制是为了给用户提供一个通过修改种子的状态(例如暂停做种)来避免种子被删除的方法。
- 不过现在我们有状态过滤器(``status``),所以这个限制就显得多余了,而且可能会使它的行为跟用户预想的不一样。
* 支持自定义删除表达式 (#15)。
- 现在我们可以直接而明确地写出我们想要的表达式了,例如 ``remove: ratio > 1``。
- 复合的条件表达式也支持,例如 ``remove: (seeding_time < 86400 and ratio > 1) or (seeding_time > 86400 and ratio > 3)``。
- 旧的写法仍然可用。

**2019-04-17 周三**: 1.3.0 版本。

* 修复了在 qBittorrent 拥有大量的种子时程序会卡住的问题 (`Issue #22 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/22>`_)。
* 修复了状态过滤器在工作时会写入重复的日志的问题。
* 日志系统已更新:
- 日志路径可以被指定(使用 ``--log`` 参数,例如 ``--log=/home/jerrymakesjelly/logs``) (`Issue #23 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/23>`_)。
- 日志文件将按天存储在不同的文件中(格式:``autoremove.%Y-%m-%d.log``)。
* 全部单词 ``seed`` 修改为 ``torrent`` (`Issue #25 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/25>`_)。
* 删去了所有不必要的调试日志。

**2019-01-10 周一**: 1.2.5 版本。

* 修复了在设置多个策略时种子数量不正确的问题 (`Issue #10 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/10>`_, 感谢 @momokoo 报告此问题并提出 PR).
* 修复了在 qBittorrent 中种子数不正确的问题 (`Issue #13 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/13>`_)。

**2018-05-31 周四**: 1.2.4 版本。

* 修复了启动失败的问题。

**2018-05-30 周三**: 1.2.3 版本。增加了一些功能。

* 允许使用环境变量去指定 ``host``、``username`` 和 ``password``。
* 允许 ``username`` 和 ``password`` 留空(或者其中之一留空),使得不用用户名或密码也可以登录 WebUI。
* 现在程序在一个任务失败时不会直接退出。

**2018-05-27 周日**: 1.2.2 版本。 增加了一些功能 :smile:

* 增加了新过滤器:种子状态。
* 增加了新条件:最大种子数量。

**2018-05-26 周六**: 1.2.1 版本。 修复了 ``setup.py`` 的问题。

**2018-05-26 周六**: 1.2.0 版本. 重构已完成,程序已发布至 PyPI。

* 新特性很快会被加入。
* 现在你可以通过 ``pip`` 安装程序。

**2018-05-14 周一**: 1.1.0 版本。 创建了 ``setup.py``。

现在你可以直接使用 ``autoremove-torrents`` 命令而不是 ``python3 main.py``。

**2018-03-28 周三**: (更正文档) ``delete_data`` 字段不应该被缩进。

**2018-03-22 周四**: 第一个版本 :bowtie:
.. _更多更新日志: https://autoremove-torrents.readthedocs.io/zh_CN/latest/changelog.html

计划列表
-----------
Expand Down
151 changes: 23 additions & 128 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,146 +109,41 @@ Screenshot
-----------
|Screenshot|

.. |Screenshot| image:: https://user-images.githubusercontent.com/6760674/40576720-a78097fe-612d-11e8-9dda-8aac0c5011a2.png
.. |Screenshot| image:: https://user-images.githubusercontent.com/6760674/174464634-15743d59-f1dc-41c9-bff6-6d90becaeb67.gif

Changelog
----------
**Thu, 27 Aug 2020**: Version 1.5.3.
**Sun, 19 June 2022**: Version 1.5.4.

* Fix psutil's compatibility in Synology (use to check the free spaces). (#61)
* Enable to output debug logs by specifying ``--debug`` or ``-d`` argument. (#76)
* Fix API imcompatibility issue caused by the trailing ``/`` in host URL. (#81)
* Add uploaded size and downloaded size conditions. (#79)
Changes
++++++++

**Fri, 27 Mar 2020**: Version 1.5.2.
* Remove outgoing port status info. (#101) (#135)
- We have confirmed a bug, which is, the outgoing port status checker will fail and report 'portTested: http error 400: Bad Request' when we are using Transmission and check the outgoing port status in IPv6 network.
- Since there are no configurations relying on this status, we remove it.

* Support Deluge. (#8)
* Use batch delete to improve efficiency.
* Fix multi-language support in config file. (#69)
* Set the client names to be case-insensitive.
* Change ``last_activity``'s behaviour. (#93) (#98) (#109)
- It won't remove those torrents that have never been active anymore.
- These torrents that have never been active can be removed by the following configuration:
+ ``last_activity: never`` or ``last_activity: none`` for ``last_activity`` condition.
+ ``last_activity = never`` or ``last_activity = none`` for ``remove`` expression.

**Sat, 29 Feb 2020**: Version 1.5.1.
Features
+++++++++

* Fix missing status ``StalledUpload`` and ``StalledDownload`` in version 1.5.0. (#66)
* Add ``remove-slow-upload-seeds`` and ``remove-fast-upload-seeds`` in actions. (#127) Thanks to @vincent906!
* Support equality (``=``) comparison in remove expression.
* Add downloading time condition. (#88) Thanks to @dantebarba!

**Fri, 28 Feb 2020**: Version 1.5.0.

* Fix a problem: cannot login to client with numeric username or password. (#64)
* Fix a problem: tasks could not be executed in a Transmission without label properties.
* Fix a problem: removing conditions may not work for unlabeled and trackerless torrents.
* Fix a problem: missing status ``Queued`` in μTorrent.
* Add new status ``Error`` to filter ``status``.
* Add support for Transmission labels. (#24)
* Add removing conditions: Maximum Download Speed ``max_downloadspeed`` and Minimum Upload Speed ``min_uploadspeed``.
* Add removing conditions: Maximum Average Download Speed ``max_average_downloadspeed`` and Minimum Average Upload Speed ``min_average_uploadspeed``. (#49)
* Add removing conditions: Maximum Torrent Size ``max_size``. (#21)
* Add removing conditions: Maximum Number of Seeders ``max_seeder`` and Minimum Number of Leechers ``min_leecher``. (#62)
* Add removing conditions: Maximum Number of Connected Seeders ``max_connected_seeder`` and Minimum Number of Connected Leechers ``min_connected_leecher``.
* Add a removing condition: Last Activity ``last_activity``, which removes torrents without upload or download speed for a period of time. (#1) (#9)
* Add a removing condition: Maximum Download Progress ``max_progress``.
* Add actions: add ``remove-active-seeds`` and ``remove-inactive-seeds`` to ``free_space``, ``maximum_number`` and ``seed_size`` in order to try to remove active or inactive torrents based on the last active time. (#9)
* Add a removing condition: Upload Ratio ``upload_ratio``, which can remove torrents based on the ratio of uploaded size to torrent size. (#55)

**Mon, 3 Feb 2020**: Migrate documents to Read the Docs.

**Sun, 26 Jan 2020**: Version 1.4.9.

* Add `free_space` condition.

**Tue, 7 Jan 2020**: Version 1.4.8.

* Fix bug that cannot delete torrents in qBittorrent v4.2.1+. Sorry for any inconvenience. (#53)

**Mon, 6 Jan 2020**: Version 1.4.7.

* Add support for new API in qBittorrent 4.2.1. (#46) **Note: This version has a bug. Please upgrade to v1.4.8 or higher.**

**Tue, 17 Sep 2019**: Version 1.4.6.

* Fix problem that the tracker filter needs to specific ports when the tracker URL includes port number. (#38)

**Thu, 6 Jun 2019**: Version 1.4.5.

* Added status `StalledUpload` and `StalledDownload`. (#34)

**Wed, 22 May 2019**: Version 1.4.4.

* Fixed a bug that when condition `seed_size` / `maximum_number` is used together with condtion `ratio` / `create_time` / `seeding_time`, the task will fail. (#33)
* New feature: if the content of `filter` has only one line, now it is allowed to write down directly without using list.

**Sun, 19 May 2019**: Version 1.4.3.

* Supported Python 2.7. (#29)
* Stopped supporting Python 3.4. (kennethreitz/requests#5092)

**Mon, 13 May 2019**: Version 1.4.2.

* Fixed missing parser files. (#32)
* Fixed association of operators. (#32) Now the operator `and` and `or` are guaranteed to be left-associative.

**Mon, 6 May 2019**: Version 1.4.1.

* Fixed missing dependency: `ply`.
* Fixed the warning of duplicate definition in condition `remove`.

**Mon, 6 May 2019**: Updated Wiki.

* Added the description of `remove` condition into Simplified-Chinese Wiki.

**Wed, 1 May 2019**: Version 1.4.0.

* Removed torrent status restriction in ``seeding_time`` and ``ratio`` condition (#19).
- Before this version, ``seeding_time`` and ``ratio`` condition will only remove those torrents whose status are seeding. We set this restriction to provide a method for users to avoid a torrent being removed by changing its status (e.g. pause seeding).
- But now we have a ``status`` filter, this restriction becomes unnecessary, and its behavior may be different from users expectation.
* Supported custom remove expressions (#15).
- Now we can write the condition that we want directly and clearly, e.g. ``remove: ratio > 1``.
- Composite condition expressions are also supported, e.g. ``remove: (seeding_time < 86400 and ratio > 1) or (seeding_time > 86400 and ratio > 3)``. Visit Wiki to learn more.
- The old remove conditions are still available.

**Wed, 17 Apr 2019**: Version 1.3.0.

* Fixed bug: Program gets stuck when there are a lot of torrents in qBittorrent client (`Issue #22 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/22>`_).
* Fixed bug: Duplicated logging in status filter.
* Log system was updated:
- Log path can be specified (Use ``--log`` argument, e.g. ``--log=/home/jerrymakesjelly/logs``) (`Issue #23 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/23>`_).
- Logs are stored in different files by day (Format: ``autoremove.%Y-%m-%d.log``).
* Changed the word ``seed`` to ``torrent`` (`Issue #25 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/25>`_).
* Removed uncessary debug messages.

**Mon, 10 Jan 2019**: Version 1.2.5.

* Fixed bug: Incorrect number of torrents in multiple strategies (`Issue #10 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/10>`_, thanks to @momokoo for the report and PR).
* Fixed bug: Incorrect number of torrents in qBittorrent (`Issue #13 <https://github.com/jerrymakesjelly/autoremove-torrents/issues/13>`_).

**Thu, 31 May 2018**: Version 1.2.4.

* Fixed startup failure.

**Wed, 30 May 2018**: Version 1.2.3. Added new features.

* Allowed to use environment variables to specify *host*, *username* and *password*.
* Allowed *username* and *password* to be empty (or one of them is empty) to log in a WebUI without username and/or password.
* Now the program won't quit directly when a task goes failed.

**Sun, 27 May 2018**: Version 1.2.2. Added new features :smile:

* Added new filter: Torrent Status
* Added new condition: Maximum number of torrents

**Sat, 26 May 2018**: Version 1.2.1. Fixed issue in *setup.py*.

**Sat, 26 May 2018**: Version 1.2.0. Refactoring was completed, and was published to PyPI.

* New features will be added soon.
* Now we can install it via *pip*.

**Mon, 14 May 2018**: Version 1.1.0. Created *setup.py*.
Fix
++++

You can now use the *autoremove-torrents* command directly instead of *python3 main.py*.
* Fix a bug that Downloaded/Uploaded Size conditions and ``free_space``/``remote_free_space`` cannot handle decimals correctly. (#133) Thanks to @sfwn!
* Fix a bug that ``last_activity`` condition doesn't work in Deluge 2.0.3 and above. (#119)

**Wed, 28 Mar 2018**: (Correct document) The *delete_data* field shouldn't be indented.
`More changelogs`_

**Thu, 22 Mar 2018**: First version :bowtie:
.. _More changelogs: https://autoremove-torrents.readthedocs.io/en/latest/changelog.html

TODO List
-----------
Expand Down
9 changes: 2 additions & 7 deletions autoremovetorrents/client/deluge.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from deluge_client.client import DelugeClientException
from ..torrent import Torrent
from ..clientstatus import ClientStatus
from ..portstatus import PortStatus
from ..torrentstatus import TorrentStatus
from ..exception.loginfailure import LoginFailure
from ..exception.remotefailure import RemoteFailure
Expand Down Expand Up @@ -66,10 +65,6 @@ def client_status(self):
cs.upload_speed = session_stats['payload_upload_rate']
cs.total_uploaded = session_stats['total_upload']

# Get port status
port_is_open = self._call('core.test_listen_port')
cs.port_status = PortStatus.Open if port_is_open else PortStatus.Closed

return cs

# Get Deluge version
Expand Down Expand Up @@ -154,8 +149,8 @@ def torrent_properties(self, torrent_hash):
download_time = torrent['active_time'] - torrent['finished_time']
torrent_obj.average_download_speed = torrent['all_time_download'] / download_time if download_time > 0 else 0
if 'time_since_transfer' in torrent:
# Set the last active time of those never active torrents to timestamp 0
torrent_obj.last_activity = torrent['time_since_transfer'] if torrent['time_since_transfer'] > 0 else 0
torrent_obj.last_activity = torrent['time_since_transfer'] \
if torrent['time_since_transfer'] > 0 else None
torrent_obj.progress = torrent['progress'] / 100 # Accept Range: 0-1

return torrent_obj
Expand Down

0 comments on commit 674e71f

Please sign in to comment.