Merge pull request #236 from storytold/brandon-creator-details

add creator details
This commit is contained in:
Brandon Thomas authored and GitHub committed 2023-12-21 04:29:36 -05:00
commit bd688703df
4 files changed
+170 -68

No files matched your search

@@ -1,6 +1,6 @@
{
"db_name": "MySQL",
"query": "\n SELECT\n wt.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n wt.title,\n wt.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n wt.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n wt.maybe_thumbnail_token,\n wt.description_markdown,\n wt.description_rendered_html,\n wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n wt.creator_ip_address,\n wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n wt.original_download_url,\n wt.original_filename,\n wt.file_size_bytes,\n wt.file_checksum_sha2,\n wt.public_bucket_hash,\n wt.maybe_public_bucket_prefix,\n wt.maybe_public_bucket_extension,\n\n avatar.public_bucket_directory_hash as maybe_avatar_public_bucket_hash,\n avatar.maybe_public_bucket_prefix as maybe_avatar_public_bucket_prefix,\n avatar.maybe_public_bucket_extension as maybe_avatar_public_bucket_extension,\n\n wt.cached_user_ratings_negative_count,\n wt.cached_user_ratings_positive_count,\n wt.cached_user_ratings_total_count,\n wt.maybe_cached_user_ratings_ratio,\n wt.cached_user_ratings_last_updated_at,\n wt.version,\n wt.created_at,\n wt.updated_at,\n wt.user_deleted_at,\n wt.mod_deleted_at\n FROM model_weights as wt\n LEFT OUTER JOIN media_files as avatar\n ON avatar.token = wt.maybe_avatar_media_file_token\n WHERE\n wt.token = ?\n ",
"query": "\n SELECT\n wt.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n wt.title,\n wt.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n wt.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n wt.maybe_thumbnail_token,\n wt.description_markdown,\n wt.description_rendered_html,\n\n wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash AS creator_gravatar_hash,\n\n wt.creator_ip_address,\n wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n wt.original_download_url,\n wt.original_filename,\n wt.file_size_bytes,\n wt.file_checksum_sha2,\n wt.public_bucket_hash,\n wt.maybe_public_bucket_prefix,\n wt.maybe_public_bucket_extension,\n\n avatar.public_bucket_directory_hash as maybe_avatar_public_bucket_hash,\n avatar.maybe_public_bucket_prefix as maybe_avatar_public_bucket_prefix,\n avatar.maybe_public_bucket_extension as maybe_avatar_public_bucket_extension,\n\n wt.cached_user_ratings_negative_count,\n wt.cached_user_ratings_positive_count,\n wt.cached_user_ratings_total_count,\n wt.maybe_cached_user_ratings_ratio,\n wt.cached_user_ratings_last_updated_at,\n wt.version,\n wt.created_at,\n wt.updated_at,\n wt.user_deleted_at,\n wt.mod_deleted_at\n FROM model_weights as wt\n JOIN users\n ON users.token = wt.creator_user_token\n LEFT OUTER JOIN media_files as avatar\n ON avatar.token = wt.maybe_avatar_media_file_token\n WHERE\n wt.token = ?\n ",
"describe": {
"columns": [
{
@@ -85,6 +85,36 @@
},
{
"ordinal": 8,
"name": "creator_username",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 9,
"name": "creator_display_name",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 10,
"name": "creator_gravatar_hash",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 11,
"name": "creator_ip_address",
"type_info": {
"type": "VarString",
@@ -94,7 +124,7 @@
}
},
{
"ordinal": 9,
"ordinal": 12,
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"type_info": {
"type": "String",
@@ -104,7 +134,7 @@
}
},
{
"ordinal": 10,
"ordinal": 13,
"name": "maybe_last_update_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
@@ -114,7 +144,7 @@
}
},
{
"ordinal": 11,
"ordinal": 14,
"name": "original_download_url",
"type_info": {
"type": "VarString",
@@ -124,7 +154,7 @@
}
},
{
"ordinal": 12,
"ordinal": 15,
"name": "original_filename",
"type_info": {
"type": "VarString",
@@ -134,7 +164,7 @@
}
},
{
"ordinal": 13,
"ordinal": 16,
"name": "file_size_bytes",
"type_info": {
"type": "Long",
@@ -144,7 +174,7 @@
}
},
{
"ordinal": 14,
"ordinal": 17,
"name": "file_checksum_sha2",
"type_info": {
"type": "String",
@@ -154,7 +184,7 @@
}
},
{
"ordinal": 15,
"ordinal": 18,
"name": "public_bucket_hash",
"type_info": {
"type": "VarString",
@@ -164,7 +194,7 @@
}
},
{
"ordinal": 16,
"ordinal": 19,
"name": "maybe_public_bucket_prefix",
"type_info": {
"type": "VarString",
@@ -174,7 +204,7 @@
}
},
{
"ordinal": 17,
"ordinal": 20,
"name": "maybe_public_bucket_extension",
"type_info": {
"type": "VarString",
@@ -184,7 +214,7 @@
}
},
{
"ordinal": 18,
"ordinal": 21,
"name": "maybe_avatar_public_bucket_hash",
"type_info": {
"type": "VarString",
@@ -194,7 +224,7 @@
}
},
{
"ordinal": 19,
"ordinal": 22,
"name": "maybe_avatar_public_bucket_prefix",
"type_info": {
"type": "VarString",
@@ -204,7 +234,7 @@
}
},
{
"ordinal": 20,
"ordinal": 23,
"name": "maybe_avatar_public_bucket_extension",
"type_info": {
"type": "VarString",
@@ -214,7 +244,7 @@
}
},
{
"ordinal": 21,
"ordinal": 24,
"name": "cached_user_ratings_negative_count",
"type_info": {
"type": "Long",
@@ -224,7 +254,7 @@
}
},
{
"ordinal": 22,
"ordinal": 25,
"name": "cached_user_ratings_positive_count",
"type_info": {
"type": "Long",
@@ -234,7 +264,7 @@
}
},
{
"ordinal": 23,
"ordinal": 26,
"name": "cached_user_ratings_total_count",
"type_info": {
"type": "Long",
@@ -244,7 +274,7 @@
}
},
{
"ordinal": 24,
"ordinal": 27,
"name": "maybe_cached_user_ratings_ratio",
"type_info": {
"type": "Float",
@@ -254,7 +284,7 @@
}
},
{
"ordinal": 25,
"ordinal": 28,
"name": "cached_user_ratings_last_updated_at",
"type_info": {
"type": "Timestamp",
@@ -264,7 +294,7 @@
}
},
{
"ordinal": 26,
"ordinal": 29,
"name": "version",
"type_info": {
"type": "Long",
@@ -274,7 +304,7 @@
}
},
{
"ordinal": 27,
"ordinal": 30,
"name": "created_at",
"type_info": {
"type": "Timestamp",
@@ -284,7 +314,7 @@
}
},
{
"ordinal": 28,
"ordinal": 31,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
@@ -294,7 +324,7 @@
}
},
{
"ordinal": 29,
"ordinal": 32,
"name": "user_deleted_at",
"type_info": {
"type": "Timestamp",
@@ -304,7 +334,7 @@
}
},
{
"ordinal": 30,
"ordinal": 33,
"name": "mod_deleted_at",
"type_info": {
"type": "Timestamp",
@@ -328,6 +358,9 @@
false,
false,
false,
false,
false,
false,
true,
true,
true,
@@ -351,5 +384,5 @@
true
]
},
"hash": "a63aa483bc3a8906a5fa61362534788b757af2dc895b229385101f3b96cd9b51"
"hash": "4e30e34cdf7a5834a3981d5e634506966bac9f9c420e800d15ce313778272cee"
}
@@ -1,6 +1,6 @@
{
"db_name": "MySQL",
"query": "\n SELECT\n wt.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n wt.title,\n wt.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n wt.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n wt.maybe_thumbnail_token,\n wt.description_markdown,\n wt.description_rendered_html,\n wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n wt.creator_ip_address,\n wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n wt.original_download_url,\n wt.original_filename,\n wt.file_size_bytes,\n wt.file_checksum_sha2,\n wt.public_bucket_hash,\n wt.maybe_public_bucket_prefix,\n wt.maybe_public_bucket_extension,\n\n avatar.public_bucket_directory_hash as maybe_avatar_public_bucket_hash,\n avatar.maybe_public_bucket_prefix as maybe_avatar_public_bucket_prefix,\n avatar.maybe_public_bucket_extension as maybe_avatar_public_bucket_extension,\n\n wt.cached_user_ratings_negative_count,\n wt.cached_user_ratings_positive_count,\n wt.cached_user_ratings_total_count,\n wt.maybe_cached_user_ratings_ratio,\n wt.cached_user_ratings_last_updated_at,\n wt.version,\n wt.created_at,\n wt.updated_at,\n wt.user_deleted_at,\n wt.mod_deleted_at\n FROM model_weights as wt\n LEFT OUTER JOIN media_files as avatar\n ON avatar.token = wt.maybe_avatar_media_file_token\n WHERE\n wt.token = ?\n AND wt.user_deleted_at IS NULL\n AND wt.mod_deleted_at IS NULL\n ",
"query": "\n SELECT\n wt.token as `token: tokens::tokens::model_weights::ModelWeightToken`,\n wt.title,\n wt.weights_type as `weights_type: enums::by_table::model_weights::weights_types::WeightsType`,\n wt.weights_category as `weights_category: enums::by_table::model_weights::weights_category::WeightsCategory`,\n wt.maybe_thumbnail_token,\n wt.description_markdown,\n wt.description_rendered_html,\n wt.creator_ip_address,\n wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,\n\n wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,\n users.username as creator_username,\n users.display_name as creator_display_name,\n users.email_gravatar_hash AS creator_gravatar_hash,\n\n wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,\n wt.original_download_url,\n wt.original_filename,\n wt.file_size_bytes,\n wt.file_checksum_sha2,\n wt.public_bucket_hash,\n wt.maybe_public_bucket_prefix,\n wt.maybe_public_bucket_extension,\n\n avatar.public_bucket_directory_hash as maybe_avatar_public_bucket_hash,\n avatar.maybe_public_bucket_prefix as maybe_avatar_public_bucket_prefix,\n avatar.maybe_public_bucket_extension as maybe_avatar_public_bucket_extension,\n\n wt.cached_user_ratings_negative_count,\n wt.cached_user_ratings_positive_count,\n wt.cached_user_ratings_total_count,\n wt.maybe_cached_user_ratings_ratio,\n wt.cached_user_ratings_last_updated_at,\n wt.version,\n wt.created_at,\n wt.updated_at,\n wt.user_deleted_at,\n wt.mod_deleted_at\n FROM model_weights as wt\n JOIN users\n ON users.token = wt.creator_user_token\n LEFT OUTER JOIN media_files as avatar\n ON avatar.token = wt.maybe_avatar_media_file_token\n WHERE\n wt.token = ?\n AND wt.user_deleted_at IS NULL\n AND wt.mod_deleted_at IS NULL\n ",
"describe": {
"columns": [
{
@@ -75,16 +75,6 @@
},
{
"ordinal": 7,
"name": "creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 8,
"name": "creator_ip_address",
"type_info": {
"type": "VarString",
@@ -94,7 +84,7 @@
}
},
{
"ordinal": 9,
"ordinal": 8,
"name": "creator_set_visibility: enums::common::visibility::Visibility",
"type_info": {
"type": "String",
@@ -103,8 +93,48 @@
"max_size": 28
}
},
{
"ordinal": 9,
"name": "creator_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | MULTIPLE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 10,
"name": "creator_username",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | UNIQUE_KEY | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 11,
"name": "creator_display_name",
"type_info": {
"type": "VarString",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 80
}
},
{
"ordinal": 12,
"name": "creator_gravatar_hash",
"type_info": {
"type": "String",
"flags": "NOT_NULL | BINARY | NO_DEFAULT_VALUE",
"char_set": 224,
"max_size": 128
}
},
{
"ordinal": 13,
"name": "maybe_last_update_user_token: tokens::tokens::users::UserToken",
"type_info": {
"type": "VarString",
@@ -114,7 +144,7 @@
}
},
{
"ordinal": 11,
"ordinal": 14,
"name": "original_download_url",
"type_info": {
"type": "VarString",
@@ -124,7 +154,7 @@
}
},
{
"ordinal": 12,
"ordinal": 15,
"name": "original_filename",
"type_info": {
"type": "VarString",
@@ -134,7 +164,7 @@
}
},
{
"ordinal": 13,
"ordinal": 16,
"name": "file_size_bytes",
"type_info": {
"type": "Long",
@@ -144,7 +174,7 @@
}
},
{
"ordinal": 14,
"ordinal": 17,
"name": "file_checksum_sha2",
"type_info": {
"type": "String",
@@ -154,7 +184,7 @@
}
},
{
"ordinal": 15,
"ordinal": 18,
"name": "public_bucket_hash",
"type_info": {
"type": "VarString",
@@ -164,7 +194,7 @@
}
},
{
"ordinal": 16,
"ordinal": 19,
"name": "maybe_public_bucket_prefix",
"type_info": {
"type": "VarString",
@@ -174,7 +204,7 @@
}
},
{
"ordinal": 17,
"ordinal": 20,
"name": "maybe_public_bucket_extension",
"type_info": {
"type": "VarString",
@@ -184,7 +214,7 @@
}
},
{
"ordinal": 18,
"ordinal": 21,
"name": "maybe_avatar_public_bucket_hash",
"type_info": {
"type": "VarString",
@@ -194,7 +224,7 @@
}
},
{
"ordinal": 19,
"ordinal": 22,
"name": "maybe_avatar_public_bucket_prefix",
"type_info": {
"type": "VarString",
@@ -204,7 +234,7 @@
}
},
{
"ordinal": 20,
"ordinal": 23,
"name": "maybe_avatar_public_bucket_extension",
"type_info": {
"type": "VarString",
@@ -214,7 +244,7 @@
}
},
{
"ordinal": 21,
"ordinal": 24,
"name": "cached_user_ratings_negative_count",
"type_info": {
"type": "Long",
@@ -224,7 +254,7 @@
}
},
{
"ordinal": 22,
"ordinal": 25,
"name": "cached_user_ratings_positive_count",
"type_info": {
"type": "Long",
@@ -234,7 +264,7 @@
}
},
{
"ordinal": 23,
"ordinal": 26,
"name": "cached_user_ratings_total_count",
"type_info": {
"type": "Long",
@@ -244,7 +274,7 @@
}
},
{
"ordinal": 24,
"ordinal": 27,
"name": "maybe_cached_user_ratings_ratio",
"type_info": {
"type": "Float",
@@ -254,7 +284,7 @@
}
},
{
"ordinal": 25,
"ordinal": 28,
"name": "cached_user_ratings_last_updated_at",
"type_info": {
"type": "Timestamp",
@@ -264,7 +294,7 @@
}
},
{
"ordinal": 26,
"ordinal": 29,
"name": "version",
"type_info": {
"type": "Long",
@@ -274,7 +304,7 @@
}
},
{
"ordinal": 27,
"ordinal": 30,
"name": "created_at",
"type_info": {
"type": "Timestamp",
@@ -284,7 +314,7 @@
}
},
{
"ordinal": 28,
"ordinal": 31,
"name": "updated_at",
"type_info": {
"type": "Timestamp",
@@ -294,7 +324,7 @@
}
},
{
"ordinal": 29,
"ordinal": 32,
"name": "user_deleted_at",
"type_info": {
"type": "Timestamp",
@@ -304,7 +334,7 @@
}
},
{
"ordinal": 30,
"ordinal": 33,
"name": "mod_deleted_at",
"type_info": {
"type": "Timestamp",
@@ -328,6 +358,9 @@
false,
false,
false,
false,
false,
false,
true,
true,
true,
@@ -351,5 +384,5 @@
true
]
},
"hash": "a9ee4dedd7375b2baec864892d1358f99f63edacbab6bf4a0c43732884c8f11a"
"hash": "93084dc42ae4ada186dc90bdd470122342586f4f19a3ac961286c1c54a5c32b2"
}
@@ -22,9 +22,15 @@ pub struct RetrivedModelWeight {
pub maybe_thumbnail_token: Option<String>,
pub description_markdown: String,
pub description_rendered_html: String,
pub creator_user_token: UserToken,
pub creator_username: String,
pub creator_display_name: String,
pub creator_gravatar_hash: String,
pub creator_ip_address: String,
pub creator_set_visibility: Visibility,
pub maybe_last_update_user_token: Option<UserToken>,
pub original_download_url: Option<String>,
pub original_filename: Option<String>,
@@ -93,6 +99,9 @@ pub async fn get_weights_by_token_with_connection(
description_markdown: record.description_markdown,
description_rendered_html: record.description_rendered_html,
creator_user_token: record.creator_user_token,
creator_username: record.creator_username,
creator_display_name: record.creator_display_name,
creator_gravatar_hash: record.creator_gravatar_hash,
creator_ip_address: record.creator_ip_address,
creator_set_visibility: record.creator_set_visibility,
maybe_last_update_user_token: record.maybe_last_update_user_token,
@@ -136,7 +145,12 @@ async fn select_include_deleted(
wt.maybe_thumbnail_token,
wt.description_markdown,
wt.description_rendered_html,
wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,
users.username as creator_username,
users.display_name as creator_display_name,
users.email_gravatar_hash AS creator_gravatar_hash,
wt.creator_ip_address,
wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,
wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,
@@ -163,6 +177,8 @@ async fn select_include_deleted(
wt.user_deleted_at,
wt.mod_deleted_at
FROM model_weights as wt
JOIN users
ON users.token = wt.creator_user_token
LEFT OUTER JOIN media_files as avatar
ON avatar.token = wt.maybe_avatar_media_file_token
WHERE
@@ -191,9 +207,14 @@ async fn select_without_deleted(
wt.maybe_thumbnail_token,
wt.description_markdown,
wt.description_rendered_html,
wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,
wt.creator_ip_address,
wt.creator_set_visibility as `creator_set_visibility: enums::common::visibility::Visibility`,
wt.creator_user_token as `creator_user_token: tokens::tokens::users::UserToken`,
users.username as creator_username,
users.display_name as creator_display_name,
users.email_gravatar_hash AS creator_gravatar_hash,
wt.maybe_last_update_user_token as `maybe_last_update_user_token: tokens::tokens::users::UserToken`,
wt.original_download_url,
wt.original_filename,
@@ -218,6 +239,8 @@ async fn select_without_deleted(
wt.user_deleted_at,
wt.mod_deleted_at
FROM model_weights as wt
JOIN users
ON users.token = wt.creator_user_token
LEFT OUTER JOIN media_files as avatar
ON avatar.token = wt.maybe_avatar_media_file_token
WHERE
@@ -240,7 +263,12 @@ pub struct RawWeight {
pub maybe_thumbnail_token: Option<String>,
pub description_markdown: String,
pub description_rendered_html: String,
pub creator_user_token: UserToken,
pub creator_username: String,
pub creator_display_name: String,
pub creator_gravatar_hash: String,
pub creator_ip_address: String,
pub creator_set_visibility: Visibility,
pub maybe_last_update_user_token: Option<UserToken>,
@@ -1,26 +1,24 @@
use std::fmt;
use std::sync::Arc;
use actix_web::{HttpRequest, HttpResponse, web};
use actix_web::error::ResponseError;
use actix_web::http::StatusCode;
use actix_web::web::Path;
use chrono::{DateTime, Utc};
use log::warn;
use utoipa::ToSchema;
use buckets::public::media_files::bucket_file_path::MediaFileBucketPath;
use enums::by_table::model_weights::weights_category::WeightsCategory;
use enums::by_table::model_weights::weights_types::WeightsType;
use enums::common::visibility::Visibility;
use tokens::tokens::users::UserToken;
use mysql_queries::queries::model_weights::get_weight::get_weight_by_token;
use tokens::tokens::model_weights::ModelWeightToken;
use crate::http_server::common_responses::user_details_lite::UserDetailsLight;
use crate::server_state::ServerState;
use tokens::tokens::model_weights::ModelWeightToken;
use mysql_queries::queries::model_weights::get_weight::get_weight_by_token;
use enums::by_table::model_weights::weights_types::WeightsType;
use enums::by_table::model_weights::weights_category::WeightsCategory;
use utoipa::ToSchema;
use buckets::public::media_files::bucket_file_path::MediaFileBucketPath;
#[derive(Serialize, Clone, ToSchema)]
pub struct GetWeightResponse {
success: bool,
@@ -31,6 +29,8 @@ pub struct GetWeightResponse {
maybe_thumbnail_token: Option<String>,
description_markdown: String,
description_rendered_html: String,
creator: UserDetailsLight,
creator_set_visibility: Visibility,
file_size_bytes: i32,
@@ -154,6 +154,13 @@ pub async fn get_weight_handler(
.to_string()
});
let creator = UserDetailsLight::from_db_fields(
&weight.creator_user_token,
&weight.creator_username,
&weight.creator_display_name,
&weight.creator_gravatar_hash,
);
let response = GetWeightResponse {
success: true,
weight_token: weight.token,
@@ -164,6 +171,7 @@ pub async fn get_weight_handler(
description_markdown: weight.description_markdown,
description_rendered_html: weight.description_rendered_html,
maybe_avatar_public_bucket_path: maybe_avatar,
creator,
creator_set_visibility: weight.creator_set_visibility,
file_size_bytes: weight.file_size_bytes,
file_checksum_sha2: weight.file_checksum_sha2,