🐛 补充历史文件过期状态
This commit is contained in:
@@ -299,6 +299,13 @@ async def analytics(start: str = "", end: str = ""):
|
||||
def iso(value):
|
||||
return value.isoformat() if value else ""
|
||||
|
||||
def current_file_expired(file_item) -> bool:
|
||||
if not file_item:
|
||||
return False
|
||||
if file_item.expired_at and file_item.expired_at < now:
|
||||
return True
|
||||
return file_item.expired_count == 0
|
||||
|
||||
def history_row(code: str, data: dict) -> dict:
|
||||
file_item = file_map.get(code)
|
||||
current_name = ""
|
||||
@@ -320,6 +327,7 @@ async def analytics(start: str = "", end: str = ""):
|
||||
"upload_count": data.get("uploads") or 0,
|
||||
"upload_traffic": str(data.get("uploadTraffic") or 0),
|
||||
"current": bool(file_item),
|
||||
"expired": current_file_expired(file_item),
|
||||
"deleted": bool(data.get("deleted")) and not bool(file_item),
|
||||
"created_at": iso(uploaded_at),
|
||||
"uploaded_at": iso(uploaded_at),
|
||||
|
||||
Reference in New Issue
Block a user