Fixed Media statistics
Build and Publish / Build and Publish Docker Image (push) Successful in 1m45s

This commit is contained in:
ab
2026-09-20 19:53:06 +03:00
parent 5fd26c816a
commit 8168d33440
+4 -7
View File
@@ -301,13 +301,10 @@ async fn portal_media_view(
) -> cot::Result<PortalMediaView> {
let media_id = media.id.unwrap();
let delivery = crate::uploads::media_delivery_paths(&media.file_type, &media.file_path);
let url = storage
.public_url(
&delivery.media_path,
format!("/client/{client_token}/media/{media_id}"),
)
.await
.map_err(crate::uploads::storage_error)?;
// Always route full-size opens through our handler so the view is counted
// even with R2 storage (the handler records the event, then redirects to the
// signed URL). Thumbnails are still served directly and are not counted.
let url = format!("/client/{client_token}/media/{media_id}");
let thumbnail_fallback = format!("/client/{client_token}/media/{media_id}/thumbnail");
let thumbnail_url = if storage.is_r2()
&& storage