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

优化'种子季过滤',将求子集改为求交集 #2756

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BrettDean
Copy link
Contributor

【INFO】2024-09-20 20:01:15,686 - search.py - 匹配完成,共匹配到 1 个资源
【INFO】2024-09-20 20:01:15,687 - search.py - 开始过滤规则过滤,当前规则:{'include': None, 'exclude': None, 'quality': None, 'resolution': None, 'effect': None, 'tv_size': None, 'movie_size': None, 'min_seeders': None, 'min_seeders_time': None} ...
【INFO】2024-09-20 20:01:15,689 - search.py - 过滤规则过滤完成,剩余 1 个资源
【INFO】2024-09-20 20:01:15,690 - search.py - 开始优先级规则/剧集过滤,当前规则: CNSUB & !DOLBY & H264 & !BLU > CNSUB & !DOLBY & !BLU > !DOLBY & H264 & !BLU > !DOLBY & !BLU  ...
【DEBUG】2024-09-20 20:01:15,692 - chain - 请求模块执行:filter_torrents ...
【DEBUG】2024-09-20 20:01:15,696 - filter - 种子 xxx - Life On Top S01-S02 2009 WEBRip 720P x264 AAC 包含季 [1, 2] 不是需要的季 [1]
【WARNING】2024-09-20 20:01:15,697 - search.py - 顶级生活 没有符合优先级规则的资源
【WARNING】2024-09-20 20:01:15,698 - subscribe.py - 订阅 顶级生活 未搜索到资源

种子里有1,2两个季度,需要的是1季度,这里下载可能会更好,而不是直接判断不符合

app/modules/filter/__init__.py197行

if not set(torrent_seasons).issubset(set(seasons)):

改为

if not set(torrent_seasons).intersection(set(seasons)):

将求子集改为求交集

简单试了下:

seasons = [1]
torrent_seasons = [1, 2]

if not set(torrent_seasons).issubset(set(seasons)):
    print('求子集:不是需要的季')
else:
    print('求子集:是需要的季')
    
if not set(torrent_seasons).intersection(set(seasons)):
    print('求交集:不是需要的季')
else:
    print('求交集:是需要的季')

返回:

求子集:不是需要的季
求交集:是需要的季

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.

1 participant