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

修复当不使用专用的下载器而经常报错的问题 #22

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

xyqyear
Copy link
Contributor

@xyqyear xyqyear commented Apr 16, 2023

问题表现:如果不使用给BangumiBot专用的下载器,而是连接一个已经有种子的下载器的话,BangumiBot会尝试在redis数据库中查找这些种子的信息。因为这些种子信息在redis中不存在,rename函数中的info为None,所以会报错。

PS: 因为不知道贵项目使用的什么代码格式化器,就没有格式化这一行过长的代码。

@@ -87,7 +87,8 @@ def check_complete(self):
return

# 过滤标记为做种的已完成项目
completed = [item for item in completed if not redisDB.is_seeding(item.hash)]
# there might be torrents that are already in the downloader but not added by us
completed = [item for item in completed if redisDB.get(item.hash) and not redisDB.is_seeding(item.hash)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我没记错的话, 一个文件完成之后会从 redis 把它的相关信息删除掉,
这里 redisDB.get(hash) 一定没内容

Copy link
Contributor Author

@xyqyear xyqyear Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果这个种子不是由本程序添加的而是由用户直接向下载器添加的话,就会导致下面的rename操作失败。redis里面应该没有用户手动添加的种子的信息吧。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哦哦,懂你意思了, 我想一下。

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.

2 participants