Rename thumbnail_args to variant_args

This commit is contained in:
asonix 2024-03-31 16:23:34 -05:00
parent 74885f2932
commit 056b96d0ad
2 changed files with 8 additions and 9 deletions

View file

@ -52,7 +52,7 @@ pub(crate) async fn generate<S: Store + 'static>(
state: &State<S>, state: &State<S>,
format: InputProcessableFormat, format: InputProcessableFormat,
variant: String, variant: String,
thumbnail_args: Vec<String>, variant_args: Vec<String>,
original_details: &Details, original_details: &Details,
hash: Hash, hash: Hash,
) -> Result<(Details, Arc<str>), Error> { ) -> Result<(Details, Arc<str>), Error> {
@ -82,7 +82,7 @@ pub(crate) async fn generate<S: Store + 'static>(
state, state,
format, format,
variant.clone(), variant.clone(),
thumbnail_args, variant_args,
original_details, original_details,
hash.clone(), hash.clone(),
) )
@ -167,7 +167,7 @@ async fn process<S: Store + 'static>(
state: &State<S>, state: &State<S>,
output_format: InputProcessableFormat, output_format: InputProcessableFormat,
variant: String, variant: String,
thumbnail_args: Vec<String>, variant_args: Vec<String>,
original_details: &Details, original_details: &Details,
hash: Hash, hash: Hash,
) -> Result<(Details, Arc<str>), Error> { ) -> Result<(Details, Arc<str>), Error> {
@ -193,7 +193,7 @@ async fn process<S: Store + 'static>(
let stream = state.store.to_stream(&identifier, None, None).await?; let stream = state.store.to_stream(&identifier, None, None).await?;
let bytes = let bytes =
crate::magick::process_image_command(state, thumbnail_args, input_format, format, quality) crate::magick::process_image_command(state, variant_args, input_format, format, quality)
.await? .await?
.drive_with_stream(stream) .drive_with_stream(stream)
.into_bytes_stream() .into_bytes_stream()

View file

@ -783,9 +783,9 @@ fn prepare_process(
.parse::<InputProcessableFormat>() .parse::<InputProcessableFormat>()
.map_err(|_| UploadError::UnsupportedProcessExtension)?; .map_err(|_| UploadError::UnsupportedProcessExtension)?;
let (variant, thumbnail_args) = self::processor::build_chain(&operations, &format.to_string())?; let (variant, variant_args) = self::processor::build_chain(&operations, &format.to_string())?;
Ok((format, variant, thumbnail_args)) Ok((format, variant, variant_args))
} }
#[tracing::instrument(name = "Fetching derived details", skip(state))] #[tracing::instrument(name = "Fetching derived details", skip(state))]
@ -852,8 +852,7 @@ async fn process<S: Store + 'static>(
) -> Result<HttpResponse, Error> { ) -> Result<HttpResponse, Error> {
let alias = proxy_alias_from_query(source.into(), &state).await?; let alias = proxy_alias_from_query(source.into(), &state).await?;
let (format, variant, thumbnail_args) = let (format, variant, variant_args) = prepare_process(&state.config, operations, ext.as_str())?;
prepare_process(&state.config, operations, ext.as_str())?;
let (hash, alias, not_found) = if let Some(hash) = state.repo.hash(&alias).await? { let (hash, alias, not_found) = if let Some(hash) = state.repo.hash(&alias).await? {
(hash, alias, false) (hash, alias, false)
@ -892,7 +891,7 @@ async fn process<S: Store + 'static>(
&state, &state,
format, format,
variant, variant,
thumbnail_args, variant_args,
&original_details, &original_details,
hash, hash,
) )