Skip to content

Commit

Permalink
fix: 刷流做种时间修复
Browse files Browse the repository at this point in the history
  • Loading branch information
linyuan0213 committed Oct 17, 2024
1 parent 8d4bc7d commit db301b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/downloader/client/qbittorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,11 +738,11 @@ def torrent_properties(self, torrent):
torrent_obj.id = torrent.get("hash")
torrent_obj.name = torrent.get("name")
# 下载时间
torrent_obj.download_time = date_now - \
torrent.get("added_on") if torrent.get("added_on") else 0
torrent_obj.download_time = (date_now - \
torrent.get("added_on")) if torrent.get("added_on") else 0
# 做种时间
torrent_obj.seeding_time = date_now - \
torrent.get("completion_on") if torrent.get(
torrent_obj.seeding_time = (date_now - \
torrent.get("completion_on")) if torrent.get(
"completion_on") else 0
# 分享率
torrent_obj.ratio = torrent.get("ratio") or 0
Expand Down
11 changes: 7 additions & 4 deletions gunicorn.conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
ssl_cert = ''
ssl_key = ''
with open(config, 'r') as f:
yaml = ruamel.yaml.YAML()
cf = yaml.load(f)
ssl_cert = cf.get('app').get('ssl_cert')
ssl_key = cf.get('app').get('ssl_key')
try:
yaml = ruamel.yaml.YAML()
cf = yaml.load(f)
ssl_cert = cf.get('app').get('ssl_cert')
ssl_key = cf.get('app').get('ssl_key')
except Exception as e:
print("【Config】config.yaml 异常请删除重新配置...")

ROOT_PATH = os.path.dirname(os.path.abspath(config))
LOG_PATH = os.path.join(ROOT_PATH, 'logs')
Expand Down

0 comments on commit db301b9

Please sign in to comment.