block file info for incomplete files
This commit is contained in:
@@ -98,7 +98,10 @@ def record_job_event(profile_id: int, action: str, status: str, payload: dict |
|
||||
severity = "danger" if status == "failed" else "info"
|
||||
if action in {"add_magnet", "add_torrent_raw"}:
|
||||
name = str(payload.get("name") or payload.get("filename") or payload.get("uri") or "torrent")[:300]
|
||||
msg = f"{action} {status}: {name}"
|
||||
# Note: Keep the internal action name stable, but show a user-facing label instead of raw worker identifiers.
|
||||
source_label = "Torrent file" if action == "add_torrent_raw" else "Magnet link"
|
||||
status_label = {"started": "queued", "done": "added", "failed": "failed"}.get(str(status), str(status))
|
||||
msg = f"{source_label} {status_label}: {name}"
|
||||
record(profile_id, "torrent_added" if status == "done" else event_type, msg, severity=severity, source="job", action=action, details={"job_id": job_id, "status": status, "directory": payload.get("directory"), "label": payload.get("label"), "error": error, "result": result}, user_id=user_id)
|
||||
return
|
||||
if not hashes:
|
||||
|
||||
Reference in New Issue
Block a user