upload image route

This commit is contained in:
Brandon Thomas committed 2023-09-12 20:04:58 -04:00
1 parent c47bae40d4
commit 24f6b3c2f6
3 files changed
+10 -2

No files matched your search

@@ -79,12 +79,15 @@ pub async fn process_job(args: SadTalkerProcessJobArgs<'_>) -> Result<JobSuccess
match job_args.audio_source {
LipsyncAnimationAudioSource::F(media_file_token) => {
// TODO(bt, 2023-09-08): Implement
return Err(ProcessSingleJobError::from_anyhow_error(anyhow!("not yet implemented")))
}
LipsyncAnimationAudioSource::U(media_upload_token) => {
// TODO(bt, 2023-09-08): Implement
return Err(ProcessSingleJobError::from_anyhow_error(anyhow!("not yet implemented")))
}
LipsyncAnimationAudioSource::T(tts_result_token) => {
// TODO(bt, 2023-09-08): Implement
return Err(ProcessSingleJobError::from_anyhow_error(anyhow!("not yet implemented")))
}
LipsyncAnimationAudioSource::V(voice_conversion_result_token) => {
@@ -292,8 +292,8 @@ pub async fn handle_upload(
maybe_original_mime_type: maybe_mimetype,
maybe_original_audio_encoding: maybe_codec_name.as_deref(),
maybe_original_video_encoding: None,
maybe_original_frame_width: None,
maybe_original_frame_height: None,
maybe_original_frame_width: None, // TODO
maybe_original_frame_height: None, // TODO
checksum_sha2: &hash,
public_upload_path: &public_upload_path,
maybe_extra_file_modification_info: None,
@@ -117,6 +117,7 @@ use users_component::default_routes::add_suggested_api_v1_account_creation_and_s
use users_component::endpoints::edit_profile_handler::edit_profile_handler;
use users_component::endpoints::get_profile_handler::get_profile_handler;
use crate::http_server::endpoints::animation::enqueue_lipsync_animation::enqueue_lipsync_animation_handler;
use crate::http_server::endpoints::media_uploads::upload_image::upload_image_handler;
pub fn add_routes<T, B> (app: App<T>) -> App<T>
where
@@ -953,6 +954,10 @@ fn add_media_upload_routes<T, B> (app: App<T>) -> App<T>
.route(web::post().to(upload_audio_handler))
.route(web::head().to(|| HttpResponse::Ok()))
)
.service(web::resource("/upload_image")
.route(web::post().to(upload_image_handler))
.route(web::head().to(|| HttpResponse::Ok()))
)
.service(web::resource("/by_session/{media_type}")
.route(web::get().to(list_user_media_uploads_of_type_handler))
.route(web::head().to(|| HttpResponse::Ok()))