From 9dc603bd73a697ee97219760592cf9af956fa8b3 Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:36:31 +0800 Subject: [PATCH] feat(downloader): support first_last_piece --- app/modules/qbittorrent/qbittorrent.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/modules/qbittorrent/qbittorrent.py b/app/modules/qbittorrent/qbittorrent.py index f85bbb3f8..3d544a078 100644 --- a/app/modules/qbittorrent/qbittorrent.py +++ b/app/modules/qbittorrent/qbittorrent.py @@ -23,7 +23,8 @@ class Qbittorrent: def __init__(self, host: str = None, port: int = None, username: str = None, password: str = None, - category: bool = False, sequentail: bool = False, force_resume: bool = False, + category: bool = False, sequentail: bool = False, + force_resume: bool = False, first_last_piece=False, **kwargs): """ 若不设置参数,则创建配置文件设置的下载器 @@ -40,6 +41,7 @@ def __init__(self, host: str = None, port: int = None, self._category = category self._sequentail = sequentail self._force_resume = force_resume + self._first_last_piece = first_last_piece if self._host and self._port: self.qbc = self.__login_qbittorrent() @@ -284,6 +286,7 @@ def add_torrent(self, tags=tags, use_auto_torrent_management=is_auto, is_sequential_download=self._sequentail, + is_first_last_piece_priority=self._first_last_piece, cookie=cookie, category=category, **kwargs)