# `PhoenixReplay.Export.Job`
[🔗](https://github.com/elixir-vibe/phoenix_replay/blob/v0.6.2/lib/phoenix_replay/export/job.ex#L1)

A video export: which recording, how far it got and where the video is.

`status` moves from `:queued` to `:running`, then to `:done` with the
video at `path`, or to `:failed` with an `error` to show. A cancelled
job is `:cancelled`, after `:cancelling` while a running one stops.
`progress` is a percentage. `node` is the node that renders the video,
whose disk it is on.

# `id`

```elixir
@type id() :: String.t()
```

# `status`

```elixir
@type status() :: :queued | :running | :cancelling | :done | :failed | :cancelled
```

# `t`

```elixir
@type t() :: %PhoenixReplay.Export.Job{
  error: String.t() | nil,
  finished_at: integer() | nil,
  id: id(),
  node: node() | nil,
  options: PhoenixReplay.Export.Options.t(),
  path: Path.t() | nil,
  progress: 0..100,
  recording_id: PhoenixReplay.Recording.id(),
  status: status()
}
```

# `cancellable?`

```elixir
@spec cancellable?(t()) :: boolean()
```

Whether the export can still be cancelled.

# `file?`

```elixir
@spec file?(String.t()) :: boolean()
```

Whether `name`, a file or directory in the export directory, is one an
export made: `<id>.mp4` or the `<id>` directory of its screenshots, for
an id `new/2` made or one of `PhoenixReplay.Export.Queue.Oban`'s, such as
`oban-42`.

# `finished?`

```elixir
@spec finished?(t()) :: boolean()
```

Whether the export has finished, either way.

# `new`

```elixir
@spec new(PhoenixReplay.Recording.id(), PhoenixReplay.Export.Options.t()) :: t()
```

A queued export of a recording, with the options it was asked for.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
