🐛 修复更新日志

This commit is contained in:
xtaodada 2022-11-06 15:05:50 +08:00
parent fc41e89458
commit e8a79dd15d
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -1,7 +1,10 @@
import re
from datetime import datetime
from typing import List
from defs.format_time import strf_time, strp_time
REMOVE_HTML = re.compile(r"<[^>]+>", re.S)
class Assets:
def __init__(self, data: dict):
@ -13,7 +16,8 @@ class Release:
def __init__(self, data: dict):
self.name: str = data["name"]
self.url: str = data["url"]
self.description: str = data.get("description", "")
self.descriptionHTML: str = data.get("descriptionHTML", "")
self.description = REMOVE_HTML.sub("", self.descriptionHTML).strip()
self.publishedAt: str = strf_time(data["publishedAt"])
self.publishedAtTime: datetime = strp_time(data["publishedAt"])
self.tagName: str = data["tagName"]