fix 优化目录监控通知标题计算方法

This commit is contained in:
jxxghp
2023-09-01 07:16:39 +08:00
parent 6ad78fa875
commit 8eab38c91e
2 changed files with 11 additions and 23 deletions

View File

@ -610,12 +610,16 @@ class StringUtils:
return ",".join(result)
@staticmethod
def format_ep(nums: list) -> str:
def format_ep(nums: List[int]) -> str:
"""
将剧集列表格式化为连续区间
"""
nums.sort() # 将数组排序
if not nums:
return ""
if len(nums) == 1:
return f"E{nums[0]:02d}"
# 将数组升序排序
nums.sort()
formatted_ranges = []
start = nums[0]
end = nums[0]