fix search

This commit is contained in:
jxxghp
2023-07-09 09:33:09 +08:00
parent 137d952028
commit 77bc8ce8ee
2 changed files with 13 additions and 8 deletions

View File

@ -180,19 +180,19 @@ class TorrentHelper:
_meta = _context.meta_info
_torrent = _context.torrent_info
# 站点优先级
_site_order = 999 - _torrent.site_order
_site_order = 999 - (_torrent.site_order or 0)
# 季数
_season_len = str(len(_meta.season_list)).rjust(2, '0')
# 集数
_episode_len = str(9999 - len(_meta.episode_list)).rjust(4, '0')
if settings.TORRENT_PRI == "seeder":
# 排序:标题、资源类型、站点、做种、季集
if settings.TORRENT_PRI != "site":
# 排序:标题、资源类型、做种、季集
return "%s%s%s%s" % (str(_torrent.title).ljust(100, ' '),
str(_torrent.pri_order).rjust(3, '0'),
str(_torrent.seeders).rjust(10, '0'),
"%s%s" % (_season_len, _episode_len))
else:
# 排序:标题、资源类型、站点、季集、做种
# 排序:标题、资源类型、站点、做种、季集
return "%s%s%s%s%s" % (str(_torrent.title).ljust(100, ' '),
str(_torrent.pri_order).rjust(3, '0'),
str(_site_order).rjust(3, '0'),