| 47 | |
| 48 | // fallow-ignore-next-line complexity |
| 49 | function printHuman(detail: HyperframesRenderDetail): void { |
| 50 | const rows: [string, string | undefined][] = [ |
| 51 | ["Render ID:", c.accent(detail.render_id)], |
| 52 | ["Status: ", colorStatus(detail.status)], |
| 53 | ["Format: ", detail.format], |
| 54 | ["Quality: ", detail.quality ?? undefined], |
| 55 | ["Fps: ", detail.fps?.toString()], |
| 56 | ["Resolution:", detail.resolution ?? undefined], |
| 57 | ["Composition:", detail.composition ?? undefined], |
| 58 | ["Title: ", detail.title ?? undefined], |
| 59 | ["Callback ID:", detail.callback_id ?? undefined], |
| 60 | [ |
| 61 | "Duration: ", |
| 62 | detail.duration !== undefined && detail.duration !== null |
| 63 | ? `${detail.duration.toFixed(2)}s` |
| 64 | : undefined, |
| 65 | ], |
| 66 | [ |
| 67 | "Created: ", |
| 68 | detail.created_at !== undefined && detail.created_at !== null |
| 69 | ? new Date(detail.created_at * 1000).toISOString() |
| 70 | : undefined, |
| 71 | ], |
| 72 | [ |
| 73 | "Completed:", |
| 74 | detail.completed_at !== undefined && detail.completed_at !== null |
| 75 | ? new Date(detail.completed_at * 1000).toISOString() |
| 76 | : undefined, |
| 77 | ], |
| 78 | ["Video URL:", detail.video_url ?? undefined], |
| 79 | ["Thumbnail:", detail.thumbnail_url ?? undefined], |
| 80 | ["Failure: ", detail.failure_message ?? undefined], |
| 81 | ]; |
| 82 | for (const [label, value] of rows) { |
| 83 | if (value === undefined) continue; |
| 84 | console.log(`${c.bold(label)} ${value}`); |
| 85 | } |
| 86 | } |