This page is the authoritative human-readable reference for every data type that appears in the MediaCleaner Pro REST API — request bodies, response envelopes, nested objects, and configuration records. All types are defined as Rust structs and enums inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/xcoder-es/media-cleaner-pro/llms.txt
Use this file to discover all available pages before exploring further.
src/api/models.rs and packages/mc-core/src/domain.rs, and exposed through utoipa-generated OpenAPI annotations.
The machine-readable OpenAPI specification at
GET /api/openapi.json is always the authoritative source of truth. If any description on this page conflicts with that spec, the spec takes precedence.StartJobRequest
StartJobRequest is the JSON body sent with POST /api/start to launch a new deduplication pipeline job. All three fields are present in every request; hamming_threshold may be omitted (sent as null) to fall back to the pipeline’s configured default.
Absolute or relative path to the directory containing the images to scan. If an empty string is provided, the server retains the value from the previous job configuration.
Absolute or relative path to the output directory where deduplicated images will be written. If an empty string is provided, the server retains the value from the previous job configuration.
Perceptual similarity threshold used when comparing dHash fingerprints. Accepts an integer in the range 0–64, where
0 means only bit-for-bit identical hashes match and 64 treats every image as a duplicate. When null, the pipeline uses the value configured in .env (default 4).Example
ControlRequest
ControlRequest is the JSON body sent with POST /api/control to manage a running or paused job. The single action field determines the operation applied to the current pipeline.
The control action to perform. Must be one of:
| Value | Effect |
|---|---|
"pause" | Suspends processing after the current file completes |
"resume" | Continues a paused pipeline from where it stopped |
"cancel" | Aborts the pipeline; any files already written to dest_dir are kept |
Example — pause
Example — resume
Example — cancel
JobResponse
JobResponse is the JSON object returned by POST /api/start. It confirms the job was accepted and provides the initial pipeline snapshot, which will have every stage in "pending" state and zeroed-out statistics at the moment of creation.
UUID v4 string that uniquely identifies this job for the lifetime of the server process. Use this value to correlate log entries and to distinguish concurrent runs.
Always
"started" when returned from POST /api/start. This field distinguishes the start response from polling responses.Initial state for each pipeline stage, listed in execution order. See StageInfo for field definitions.
Initial processing statistics snapshot. All counters are zero and rate fields are
0.0 at job start. See ProcessingStats for field definitions.true if the pipeline is actively processing images.true if the pipeline has been suspended via POST /api/control with "pause".Example
StateResponse
StateResponse is returned by GET /api/status and is also the payload type streamed as Server-Sent Events by GET /api/progress. It represents a complete point-in-time snapshot of the pipeline.
Current state of every pipeline stage. See StageInfo for the full field breakdown.
Live processing statistics. See ProcessingStats for the full field breakdown.
true when the pipeline is actively processing images.true when the job has been suspended mid-run.Recent log entries. Populated only by
GET /api/status; always an empty array in SSE events from GET /api/progress. See LogMessage for field definitions.Example
StageInfo
StageInfo is the per-stage progress record nested inside both JobResponse and StateResponse. Each entry in the stages array corresponds to one pipeline stage and is updated in place as the job runs. The status field is a serialised StageStatus enum rendered in lowercase.
Display name of the stage, e.g.
"Exact Duplicate Removal" or "AI Classification". Names are stable across API versions and safe to use as identifiers in client UI.One-sentence description of what the stage does, intended for display in tooltips or progress UIs.
Current lifecycle state of the stage. Serialised as a lowercase string from the
StageStatus enum:| Value | Meaning |
|---|---|
"pending" | Stage has not yet begun |
"running" | Stage is actively processing |
"completed" | Stage finished successfully |
"failed" | Stage aborted due to an error; see error field |
"skipped" | Stage was bypassed (e.g. disabled in PipelineConfig) |
Completion percentage as a floating-point value between
0.0 (not started) and 100.0 (fully complete).Count of images that have been handled by this stage so far.
Total number of images this stage will process. May be
0 before the stage has been initialised.ISO 8601 UTC timestamp (
chrono::DateTime<Utc>) recording when this stage transitioned to "running". null if the stage has not yet started.ISO 8601 UTC timestamp recording when this stage transitioned to
"completed", "failed", or "skipped". null if the stage is still pending or running.Human-readable error message populated when
status is "failed". null for all other status values.Example — running stage
Example — failed stage
ProcessingStats
ProcessingStats is the live statistics object nested inside both JobResponse and StateResponse. It is updated continuously as the pipeline processes each file and provides real-time visibility into throughput, resource usage, and deduplication results.
Filename (not full path) of the image currently being processed.
null when no file is being actively handled — either between stages, while paused, or after completion.Hex-encoded 64-bit difference hash (dHash) of the current file, formatted as a 16-character uppercase hex string (e.g.
"A3F0C1B28D7E6504"). null when current_file is null or when the hash has not yet been computed for the current file.Cumulative count of images determined to be unique across all stages processed so far.
Cumulative count of images flagged as duplicates across all stages processed so far.
Cumulative count of files that could not be processed due to read errors, unsupported formats, or other failures.
Current processing throughput expressed as files per second, calculated as a rolling average.
Estimated number of seconds remaining until the pipeline finishes all stages, derived from
speed and the remaining file count.Current resident memory usage of the MediaCleaner Pro process in megabytes.
Current CPU utilisation of the process as a percentage in the range 0.0–100.0. On multi-core systems this value can reflect aggregate utilisation across all cores used by the Tokio runtime.
Example
LogMessage
LogMessage represents a single structured log entry. It appears in two places: in the log_messages array returned by GET /api/status, and as the individual records returned by GET /api/logs. The SSE stream at GET /api/progress always emits an empty log_messages array — poll /api/logs for history.
ISO 8601 RFC 3339 UTC timestamp (e.g.
"2024-08-15T10:22:01Z") recording when the event was emitted by the pipeline.Log severity level. One of:
| Value | Meaning |
|---|---|
"INFO" | Normal operational events (stage transitions, file counts) |
"WARN" | Non-fatal issues that may affect output quality |
"ERROR" | Failures that caused a file or stage to be skipped |
Name of the pipeline stage that emitted this message. Uses
"system" for lifecycle events that are not attributable to a specific stage, such as job start, pause, resume, and cancellation.Human-readable log entry text. Intended for display in log viewers and debugging output; not guaranteed to be machine-parseable.
Example
PipelineConfig
PipelineConfig controls the behaviour of every stage in the deduplication pipeline. Default values are applied at server startup from environment variables (.env file). Individual jobs can override hamming_threshold via StartJobRequest; the remaining fields require a server restart to change.
PipelineConfig is not directly exposed through a dedicated API endpoint — it is an internal domain type. The effective configuration for a job is embedded in the Job record and reflected in pipeline behaviour. Set these values in your .env file before starting the server.Hamming distance threshold for dHash comparison. Default:
4. Range: 0–64. Lower values require hashes to be nearly identical; higher values match more aggressively. Override per-job via StartJobRequest.hamming_threshold.Minimum image width in pixels below which a file is filtered out before any deduplication stages run. Default:
100.Minimum image height in pixels for the same pre-filter. Default:
100.When
true, the classification stage identifies and flags icon-sized images (typically very small, square, with transparency). Default: true.When
true, the classification stage identifies and flags thumbnail images. Default: true.When
true, the classification stage identifies and flags screenshots based on aspect ratio and content heuristics. Default: true.When
true, the classification stage identifies and flags wallpaper-resolution images. Default: true.When
true, the classification stage identifies and flags document scans and page images. Default: true.Master switch for the AI classification stage. When
false, the entire classification stage is skipped and all detect_* flags are ignored. Default: true.Controls whether the quality ranking stage runs. When
true, duplicate candidates are ranked by sharpness, exposure, and resolution to select the best copy for retention. Default: true.Default configuration
Aggressive deduplication — loose threshold, classification disabled