mirror of
https://github.com/d0zingcat/MoviePilot-Plugins.git
synced 2026-05-13 23:16:47 +00:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -186,7 +186,7 @@
|
||||
"TorrentTransfer": {
|
||||
"name": "自动转移做种",
|
||||
"description": "定期转移下载器中的做种任务到另一个下载器。",
|
||||
"version": "1.2",
|
||||
"version": "1.3",
|
||||
"icon": "seed.png",
|
||||
"author": "jxxghp",
|
||||
"level": 2
|
||||
|
||||
@@ -27,7 +27,7 @@ class TorrentTransfer(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "seed.png"
|
||||
# 插件版本
|
||||
plugin_version = "1.2"
|
||||
plugin_version = "1.3"
|
||||
# 插件作者
|
||||
plugin_author = "jxxghp"
|
||||
# 作者主页
|
||||
@@ -59,6 +59,7 @@ class TorrentTransfer(_PluginBase):
|
||||
_deletesource = False
|
||||
_fromtorrentpath = None
|
||||
_autostart = False
|
||||
_transferemptylabel = False
|
||||
# 退出事件
|
||||
_event = Event()
|
||||
# 待检查种子清单
|
||||
@@ -85,6 +86,7 @@ class TorrentTransfer(_PluginBase):
|
||||
self._fromtorrentpath = config.get("fromtorrentpath")
|
||||
self._nopaths = config.get("nopaths")
|
||||
self._autostart = config.get("autostart")
|
||||
self._transferemptylabel = config.get("transferemptylabel")
|
||||
|
||||
# 停止现有任务
|
||||
self.stop_service()
|
||||
@@ -131,7 +133,8 @@ class TorrentTransfer(_PluginBase):
|
||||
"deletesource": self._deletesource,
|
||||
"fromtorrentpath": self._fromtorrentpath,
|
||||
"nopaths": self._nopaths,
|
||||
"autostart": self._autostart
|
||||
"autostart": self._autostart,
|
||||
"transferemptylabel": self._transferemptylabel
|
||||
})
|
||||
|
||||
# 启动服务
|
||||
@@ -191,7 +194,7 @@ class TorrentTransfer(_PluginBase):
|
||||
'component': 'VCol',
|
||||
'props': {
|
||||
'cols': 12,
|
||||
'md': 6
|
||||
'md': 4
|
||||
},
|
||||
'content': [
|
||||
{
|
||||
@@ -207,7 +210,7 @@ class TorrentTransfer(_PluginBase):
|
||||
'component': 'VCol',
|
||||
'props': {
|
||||
'cols': 12,
|
||||
'md': 6
|
||||
'md': 4
|
||||
},
|
||||
'content': [
|
||||
{
|
||||
@@ -218,6 +221,22 @@ class TorrentTransfer(_PluginBase):
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
'component': 'VCol',
|
||||
'props': {
|
||||
'cols': 12,
|
||||
'md': 4
|
||||
},
|
||||
'content': [
|
||||
{
|
||||
'component': 'VSwitch',
|
||||
'props': {
|
||||
'model': 'transferemptylabel',
|
||||
'label': '转移无标签种子',
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -463,7 +482,8 @@ class TorrentTransfer(_PluginBase):
|
||||
"deletesource": False,
|
||||
"fromtorrentpath": "",
|
||||
"nopaths": "",
|
||||
"autostart": True
|
||||
"autostart": True,
|
||||
"transferemptylabel": False
|
||||
}
|
||||
|
||||
def get_page(self) -> List[dict]:
|
||||
@@ -560,26 +580,37 @@ class TorrentTransfer(_PluginBase):
|
||||
|
||||
# 获取种子标签
|
||||
torrent_labels = self.__get_label(torrent, downloader)
|
||||
# 排除含有不转移的标签
|
||||
if torrent_labels and self._nolabels:
|
||||
is_skip = False
|
||||
for label in self._nolabels.split(','):
|
||||
if label in torrent_labels:
|
||||
logger.info(f"种子 {hash_str} 含有不转移标签 {label},跳过 ...")
|
||||
is_skip = True
|
||||
break
|
||||
if is_skip:
|
||||
continue
|
||||
# 排除不含有转移标签的种子
|
||||
if torrent_labels and self._includelabels:
|
||||
is_skip = False
|
||||
for label in self._includelabels.split(','):
|
||||
if label not in torrent_labels:
|
||||
logger.info(f"种子 {hash_str} 不含有转移标签 {label},跳过 ...")
|
||||
is_skip = True
|
||||
break
|
||||
if is_skip:
|
||||
|
||||
# 种子为无标签,则进行规范化
|
||||
is_torrent_labels_empty = torrent_labels == [''] or torrent_labels == [] or torrent_labels is None
|
||||
if is_torrent_labels_empty:
|
||||
torrent_labels = []
|
||||
|
||||
#根据设置决定是否转移无标签的种子
|
||||
if is_torrent_labels_empty:
|
||||
if not self._transferemptylabel:
|
||||
continue
|
||||
else:
|
||||
# 排除含有不转移的标签
|
||||
if self._nolabels:
|
||||
is_skip = False
|
||||
for label in self._nolabels.split(','):
|
||||
if label in torrent_labels:
|
||||
logger.info(f"种子 {hash_str} 含有不转移标签 {label},跳过 ...")
|
||||
is_skip = True
|
||||
break
|
||||
if is_skip:
|
||||
continue
|
||||
# 排除不含有转移标签的种子
|
||||
if self._includelabels:
|
||||
is_skip = False
|
||||
for label in self._includelabels.split(','):
|
||||
if label not in torrent_labels:
|
||||
logger.info(f"种子 {hash_str} 不含有转移标签 {label},跳过 ...")
|
||||
is_skip = True
|
||||
break
|
||||
if is_skip:
|
||||
continue
|
||||
|
||||
# 添加转移数据
|
||||
trans_torrents.append({
|
||||
|
||||
Reference in New Issue
Block a user