-
Notifications
You must be signed in to change notification settings - Fork 491
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
[功能需求] 希望自动转移做种插件可以对标签选择黑白名单模式 #74
Labels
Comments
没明白,再说详细点,或者举个例子,我结合情况评估下 |
黑名单模式,带有这些标签的种子被此插件忽略,即不转移做种。(这是插件现在的功能) 举例:在白名单模式下,设置了标签为 |
写了个代码帮助理解 def __label_filter(self) -> bool:
"""
返回值为真则跳过该种子
"""
# 获取种子标签
torrent_labels = self.__get_label()
# 判断标签是否命中
label_hit = False
# 未设置标签 或 种子无标签
if torrent_labels == '' or self._configured_labels == '':
label_hit = False
else:
# 有标签的情况
# 两者交集非空则命中
label_hit = 0 < len(
set(torrent_labels.split(','))
.intersection(
set(self._configured_labels.split(','))))
# 判断黑白名单模式, 假设_label_filter_mode设置True时为黑名单模式
is_skip = label_hit if self._label_filter_mode else not label_hit
return is_skip |
了解,抽空弄下,可以直接pr的,也不是很麻烦的样子看下来 |
感谢大佬愿意弄,我本来想pr,但是我本地环境跑不起来,不方便调试和测试插件 :( |
转成任务,看讨论区任务列表 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你使用的 NAStool 是什么版本,什么环境?
Nastool 版本: v3.2.10.7 a4c87c5
环境: docker
你想要新增或者改进什么功能?
如下图
自动转移做种
插件可以设置排除带有指定标签的种子,即黑名单模式。希望可以加个开关让用户自由选择标签黑白名单模式,毕竟可能对于某些用户来说,需要转移的种子反而是少数的。
并且这个开关的默认值是黑名单模式,如此将不会对现有配置造成影响。
The text was updated successfully, but these errors were encountered: