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> { ) -> cot::Result<PortalMediaView> {
let media_id = media.id.unwrap(); let media_id = media.id.unwrap();
let delivery = crate::uploads::media_delivery_paths(&media.file_type, &media.file_path); let delivery = crate::uploads::media_delivery_paths(&media.file_type, &media.file_path);
let url = storage // Always route full-size opens through our handler so the view is counted
.public_url( // even with R2 storage (the handler records the event, then redirects to the
&delivery.media_path, // signed URL). Thumbnails are still served directly and are not counted.
format!("/client/{client_token}/media/{media_id}"), let url = format!("/client/{client_token}/media/{media_id}");
)
.await
.map_err(crate::uploads::storage_error)?;
let thumbnail_fallback = format!("/client/{client_token}/media/{media_id}/thumbnail"); let thumbnail_fallback = format!("/client/{client_token}/media/{media_id}/thumbnail");
let thumbnail_url = if storage.is_r2() let thumbnail_url = if storage.is_r2()
&& storage && storage