PhxMediaLibrary.Workers.ProcessConversions (PhxMediaLibrary v0.6.1)

Copy Markdown View Source

Oban worker for processing media conversions.

Resolves full Conversion definitions from the model's media_conversions/0 callback, ensuring that width, height, quality, fit mode, format, and all other options are preserved during async processing.

Job Args

  • "media_id" — the binary ID of the Media record
  • "conversions" — list of conversion name strings (e.g. ["thumb", "preview"])
  • "mediable_type" — the polymorphic type string (e.g. "posts") used to discover the originating Ecto schema module and its conversion definitions

Summary

Functions

Finds the model module for the given mediable type.

Functions

find_model_module(mediable_type)

@spec find_model_module(String.t()) :: {:ok, module()} | :error

Finds the model module for the given mediable type.

Delegates to PhxMediaLibrary.ModelRegistry.find_model_module/1. Kept for backwards compatibility.