fix
This commit is contained in:
@ -1236,9 +1236,14 @@ class BrushFlow(_PluginBase):
|
|||||||
torrents.sort(key=lambda x: x.pubdate or '', reverse=True)
|
torrents.sort(key=lambda x: x.pubdate or '', reverse=True)
|
||||||
# 过滤种子
|
# 过滤种子
|
||||||
for torrent in torrents:
|
for torrent in torrents:
|
||||||
|
# 控重
|
||||||
|
if f"{torrent.site_name}{torrent.title}" in [
|
||||||
|
f"{task.get('site_name')}{task.get('title')}" for task in task_info.values()
|
||||||
|
]:
|
||||||
|
continue
|
||||||
# 保种体积(GB) 促销
|
# 保种体积(GB) 促销
|
||||||
if self._disksize \
|
if self._disksize \
|
||||||
and (torrents_size + torrent.size) > float(self._size) * 1024**3:
|
and (torrents_size + torrent.size) > float(self._disksize) * 1024**3:
|
||||||
logger.warn(f"当前做种体积 {StringUtils.str_filesize(torrents_size)} "
|
logger.warn(f"当前做种体积 {StringUtils.str_filesize(torrents_size)} "
|
||||||
f"已超过保种体积 {self._disksize},停止新增任务")
|
f"已超过保种体积 {self._disksize},停止新增任务")
|
||||||
return
|
return
|
||||||
@ -1737,15 +1742,15 @@ class BrushFlow(_PluginBase):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def __get_pubminutes(pubdate: str) -> datetime:
|
def __get_pubminutes(pubdate: str) -> datetime:
|
||||||
"""
|
"""
|
||||||
将字符串转换为时间(分钟)
|
将字符串转换为时间,并计算与当前时间差)(分钟)
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
pubdate = time.strptime(pubdate, "%Y-%m-%d %H:%M:%S")
|
if not pubdate:
|
||||||
localtz = pytz.timezone(settings.TZ)
|
return 0
|
||||||
localnowtime = datetime.now().astimezone(localtz)
|
pubdate = pubdate.replace("T", " ").replace("Z", "")
|
||||||
localpubdate = pubdate.astimezone(localtz)
|
pubdate = datetime.strptime(pubdate, "%Y-%m-%d %H:%M:%S")
|
||||||
pudate_minutes = int(localnowtime.timestamp() - localpubdate.timestamp()) / 60
|
now = datetime.now()
|
||||||
return pudate_minutes
|
return (now - pubdate).seconds // 60
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(str(e))
|
print(str(e))
|
||||||
return 0
|
return 0
|
||||||
|
Reference in New Issue
Block a user