mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-11 12:23:20 +00:00
store object name
This commit is contained in:
1 parent
a7e47951e6
commit
366bba97cb
3 files changed
+12
-3
No files matched your search
@@ -79,6 +79,8 @@ CREATE TABLE tts_models (
|
||||
-- For now, this will be a hash of the file contents.
|
||||
-- NB: NOT UNIQUE! We can allow duplicate uploads.
|
||||
private_bucket_hash CHAR(64) NOT NULL,
|
||||
-- The "full url" version of the path
|
||||
private_bucket_object_name VARCHAR(255) NOT NULL,
|
||||
|
||||
-- Calculated average, on a scale of 0-100
|
||||
-- Null with zero ratings.
|
||||
@@ -188,9 +190,13 @@ CREATE TABLE w2l_templates (
|
||||
|
||||
-- The original source image/video and the "precomputed" faces
|
||||
private_bucket_hash CHAR(64) NOT NULL,
|
||||
-- The "full url" version of the path
|
||||
private_bucket_object_name VARCHAR(255) NOT NULL,
|
||||
|
||||
-- For the thumbnail we show.
|
||||
public_bucket_hash CHAR(64) NOT NULL,
|
||||
-- The "full url" version of the path
|
||||
public_bucket_object_name VARCHAR(255) NOT NULL,
|
||||
|
||||
-- Calculated average, on a scale of 0-100
|
||||
-- Null with zero ratings.
|
||||
|
||||
@@ -111,7 +111,8 @@ WHERE id = ?
|
||||
|
||||
pub async fn insert_tts_model(pool: &MySqlPool,
|
||||
job: &TtsUploadJobRecord,
|
||||
private_bucket_hash: &str)
|
||||
private_bucket_hash: &str,
|
||||
private_bucket_object_name: &str)
|
||||
-> AnyhowResult<u64>
|
||||
{
|
||||
let model_token = random_token(32);
|
||||
@@ -130,7 +131,8 @@ SET
|
||||
creator_user_token = ?,
|
||||
creator_ip_address = ?,
|
||||
original_download_url = ?,
|
||||
private_bucket_hash = ?
|
||||
private_bucket_hash = ?,
|
||||
private_bucket_object_name = ?
|
||||
"#,
|
||||
model_token,
|
||||
updatable_slug,
|
||||
@@ -139,6 +141,7 @@ SET
|
||||
job.creator_ip_address.clone(),
|
||||
job.download_url.clone(),
|
||||
private_bucket_hash.to_string(),
|
||||
private_bucket_object_name.to_string()
|
||||
)
|
||||
.execute(pool)
|
||||
.await;
|
||||
|
||||
@@ -269,7 +269,7 @@ async fn process_job(downloader: &Downloader, job: &TtsUploadJobRecord) -> Anyho
|
||||
downloader.bucket_client.upload_filename(&object_name, &file_path).await?;
|
||||
|
||||
info!("Saving model record...");
|
||||
let id = insert_tts_model(&downloader.mysql_pool, job, &private_bucket_hash).await?;
|
||||
let id = insert_tts_model(&downloader.mysql_pool, job, &private_bucket_hash, &object_name).await?;
|
||||
|
||||
info!("Saved model record: {}", id);
|
||||
|
||||
|
||||
Reference in new issue
Block a user