remove wrapup video rendering (ffmpeg)
All checks were successful
CI / Check / Test (push) Successful in 15m34s
All checks were successful
CI / Check / Test (push) Successful in 15m34s
SPA handles wrapup visuals client-side; server-side renderer was dead code pulling in ffmpeg + image crates.
This commit is contained in:
@@ -147,54 +147,6 @@ pub async fn get_report(
|
||||
}
|
||||
}
|
||||
|
||||
#[utoipa::path(
|
||||
get, path = "/api/v1/wrapups/{id}/video",
|
||||
params(("id" = Uuid, Path, description = "Wrap-up ID")),
|
||||
responses(
|
||||
(status = 200, description = "MP4 video file", content_type = "video/mp4"),
|
||||
(status = 404, description = "Not found or video not generated"),
|
||||
),
|
||||
security(("bearer_auth" = []))
|
||||
)]
|
||||
pub async fn get_video(State(state): State<AppState>, Path(id): Path<Uuid>) -> impl IntoResponse {
|
||||
let record = match state
|
||||
.app_ctx
|
||||
.repos
|
||||
.wrapup_repo
|
||||
.get_by_id(&WrapUpId::from_uuid(id))
|
||||
.await
|
||||
{
|
||||
Ok(Some(r)) if r.status == WrapUpStatus::Ready => r,
|
||||
_ => return StatusCode::NOT_FOUND.into_response(),
|
||||
};
|
||||
let _ = record;
|
||||
let video_key = format!("wrapups/{}/video.mp4", id);
|
||||
match state
|
||||
.app_ctx
|
||||
.services
|
||||
.object_storage
|
||||
.get_stream(&video_key)
|
||||
.await
|
||||
{
|
||||
Ok(stream) => {
|
||||
let body = axum::body::Body::from_stream(stream);
|
||||
(
|
||||
StatusCode::OK,
|
||||
[
|
||||
(axum::http::header::CONTENT_TYPE, "video/mp4"),
|
||||
(
|
||||
axum::http::header::CONTENT_DISPOSITION,
|
||||
"attachment; filename=\"wrapup.mp4\"",
|
||||
),
|
||||
],
|
||||
body,
|
||||
)
|
||||
.into_response()
|
||||
}
|
||||
Err(_) => StatusCode::NOT_FOUND.into_response(),
|
||||
}
|
||||
}
|
||||
|
||||
#[utoipa::path(
|
||||
delete, path = "/api/v1/wrapups/{id}",
|
||||
params(("id" = Uuid, Path, description = "Wrap-up ID")),
|
||||
@@ -233,7 +185,6 @@ fn render_wrapup(
|
||||
report: &WrapUpReport,
|
||||
year: i32,
|
||||
ctx: &application::ports::HtmlPageContext,
|
||||
video_url: Option<String>,
|
||||
) -> axum::response::Response {
|
||||
let rating_max = report
|
||||
.rating_distribution
|
||||
@@ -265,7 +216,6 @@ fn render_wrapup(
|
||||
genre_max,
|
||||
rating_pcts,
|
||||
genre_pcts,
|
||||
video_url,
|
||||
};
|
||||
render_page(tmpl)
|
||||
}
|
||||
@@ -301,9 +251,8 @@ pub async fn get_user_wrapup_html(
|
||||
None => return StatusCode::NOT_FOUND.into_response(),
|
||||
};
|
||||
|
||||
let video_url = format!("/api/v1/wrapups/{}/video", record.id.value());
|
||||
let ctx = super::helpers::build_page_context(&state, viewer, csrf.0).await;
|
||||
render_wrapup(&report, year, &ctx, Some(video_url))
|
||||
render_wrapup(&report, year, &ctx)
|
||||
}
|
||||
|
||||
pub async fn get_global_wrapup_html(
|
||||
@@ -337,7 +286,6 @@ pub async fn get_global_wrapup_html(
|
||||
None => return StatusCode::NOT_FOUND.into_response(),
|
||||
};
|
||||
|
||||
let video_url = format!("/api/v1/wrapups/{}/video", record.id.value());
|
||||
let ctx = super::helpers::build_page_context(&state, viewer, csrf.0).await;
|
||||
render_wrapup(&report, year, &ctx, Some(video_url))
|
||||
render_wrapup(&report, year, &ctx)
|
||||
}
|
||||
|
||||
@@ -209,7 +209,6 @@ async fn wire_dependencies() -> anyhow::Result<(AppState, axum::Router)> {
|
||||
event_publisher: event_publisher_arc,
|
||||
diary_exporter: Arc::new(ExportAdapter) as Arc<dyn DiaryExporter>,
|
||||
document_parser: Arc::new(ImporterDocumentParser) as Arc<dyn DocumentParser>,
|
||||
video_renderer: None,
|
||||
},
|
||||
config: app_config,
|
||||
};
|
||||
|
||||
@@ -7,7 +7,6 @@ use utoipa::OpenApi;
|
||||
crate::handlers::wrapup::get_list,
|
||||
crate::handlers::wrapup::get_status,
|
||||
crate::handlers::wrapup::get_report,
|
||||
crate::handlers::wrapup::get_video,
|
||||
crate::handlers::wrapup::delete_wrapup_handler,
|
||||
),
|
||||
components(schemas(
|
||||
|
||||
@@ -427,10 +427,6 @@ fn api_routes(rate_limit: u64) -> Router<AppState> {
|
||||
"/wrapups/{id}/report",
|
||||
routing::get(handlers::wrapup::get_report),
|
||||
)
|
||||
.route(
|
||||
"/wrapups/{id}/video",
|
||||
routing::get(handlers::wrapup::get_video),
|
||||
)
|
||||
.route(
|
||||
"/admin/reindex-search",
|
||||
routing::post(handlers::search::post_reindex_search),
|
||||
|
||||
@@ -759,7 +759,6 @@ pub fn make_test_state(auth_service: Arc<dyn AuthService>) -> crate::state::AppS
|
||||
event_publisher: Arc::clone(&repo) as _,
|
||||
diary_exporter: Arc::clone(&repo) as _,
|
||||
document_parser: Arc::clone(&repo) as _,
|
||||
video_renderer: None,
|
||||
},
|
||||
config: AppConfig {
|
||||
allow_registration: false,
|
||||
@@ -769,8 +768,6 @@ pub fn make_test_state(auth_service: Arc<dyn AuthService>) -> crate::state::AppS
|
||||
font_path: None,
|
||||
logo_path: None,
|
||||
bg_dir: None,
|
||||
ffmpeg_path: "ffmpeg".into(),
|
||||
max_concurrent_renders: 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -450,7 +450,6 @@ async fn test_app() -> Router {
|
||||
event_publisher: Arc::new(NoopEventPublisher),
|
||||
diary_exporter: Arc::new(PanicExporter),
|
||||
document_parser: Arc::new(PanicDocumentParser),
|
||||
video_renderer: None,
|
||||
},
|
||||
config: AppConfig {
|
||||
allow_registration: false,
|
||||
@@ -460,8 +459,6 @@ async fn test_app() -> Router {
|
||||
font_path: None,
|
||||
logo_path: None,
|
||||
bg_dir: None,
|
||||
ffmpeg_path: "ffmpeg".into(),
|
||||
max_concurrent_renders: 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user