Fixed Media statistics
Build and Publish / Build and Publish Docker Image (push) Successful in 1m45s
Build and Publish / Build and Publish Docker Image (push) Successful in 1m45s
This commit is contained in:
+4
-7
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user