mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 17:38:10 +00:00
add full cdn url too
This commit is contained in:
1 parent
9add7ee1cd
commit
abccceb5bd
7 files changed
+41
-20
No files matched your search
+13
-7
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "\n SELECT\n id,\n task_status,\n task_type,\n model_type,\n provider,\n provider_job_id,\n frontend_caller,\n frontend_subscriber_id,\n frontend_subscriber_payload,\n on_complete_primary_media_file_token,\n on_complete_primary_media_file_type,\n on_complete_batch_token,\n on_complete_primary_media_file_thumbnail_url_template,\n created_at as \"created_at: DateTime<Utc>\",\n updated_at as \"updated_at: DateTime<Utc>\",\n completed_at as \"completed_at: DateTime<Utc>\"\n FROM tasks\n WHERE is_dismissed_by_user == 0\n ",
|
||||
"query": "\n SELECT\n id,\n task_status,\n task_type,\n model_type,\n provider,\n provider_job_id,\n frontend_caller,\n frontend_subscriber_id,\n frontend_subscriber_payload,\n on_complete_primary_media_file_token,\n on_complete_primary_media_file_type,\n on_complete_batch_token,\n on_complete_primary_media_file_cdn_url,\n on_complete_primary_media_file_thumbnail_url_template,\n created_at as \"created_at: DateTime<Utc>\",\n updated_at as \"updated_at: DateTime<Utc>\",\n completed_at as \"completed_at: DateTime<Utc>\"\n FROM tasks\n WHERE is_dismissed_by_user == 0\n ",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
@@ -64,24 +64,29 @@
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "on_complete_primary_media_file_thumbnail_url_template",
|
||||
"name": "on_complete_primary_media_file_cdn_url",
|
||||
"ordinal": 12,
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "created_at: DateTime<Utc>",
|
||||
"name": "on_complete_primary_media_file_thumbnail_url_template",
|
||||
"ordinal": 13,
|
||||
"type_info": "Int64"
|
||||
"type_info": "Text"
|
||||
},
|
||||
{
|
||||
"name": "updated_at: DateTime<Utc>",
|
||||
"name": "created_at: DateTime<Utc>",
|
||||
"ordinal": 14,
|
||||
"type_info": "Int64"
|
||||
},
|
||||
{
|
||||
"name": "completed_at: DateTime<Utc>",
|
||||
"name": "updated_at: DateTime<Utc>",
|
||||
"ordinal": 15,
|
||||
"type_info": "Int64"
|
||||
},
|
||||
{
|
||||
"name": "completed_at: DateTime<Utc>",
|
||||
"ordinal": 16,
|
||||
"type_info": "Int64"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
@@ -101,10 +106,11 @@
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
true
|
||||
]
|
||||
},
|
||||
"hash": "5e6a6c099fbf4dbc949d3d46d885f4072e1d0761edc109ff4e1fc92b01caf3c0"
|
||||
"hash": "37cfc2732a8a5989c317f6f4968b192ec4b210c7928dc12f6b6451fb2312798b"
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "\n UPDATE tasks\n SET \n task_status = ?,\n on_complete_primary_media_file_token = ?,\n on_complete_batch_token = ?,\n on_complete_primary_media_file_thumbnail_url_template = ?\n WHERE id = ?\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 5
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "49c878f5ea50d249260ce4877a6c2072ede9145b83935561563b3dcbd8f79b5d"
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"db_name": "SQLite",
|
||||
"query": "\n UPDATE tasks\n SET \n task_status = ?,\n on_complete_primary_media_file_token = ?,\n on_complete_batch_token = ?,\n on_complete_primary_media_file_cdn_url = ?,\n on_complete_primary_media_file_thumbnail_url_template = ?\n WHERE id = ?\n ",
|
||||
"describe": {
|
||||
"columns": [],
|
||||
"parameters": {
|
||||
"Right": 6
|
||||
},
|
||||
"nullable": []
|
||||
},
|
||||
"hash": "f8f41a7ae3543655cd74bbcb186b7f3810909ac9b64c6a524f881594f6012673"
|
||||
}
|
||||
@@ -10,10 +10,11 @@
|
||||
-- tasks_v2.sqlite - added model_type (nullable)
|
||||
-- tasks_v3.sqlite - added frontend_caller, comments
|
||||
-- tasks_v4.sqlite - added is_dismissed_by_user
|
||||
-- tasks_v5.sqlite - added four fields:
|
||||
-- tasks_v5.sqlite - added five fields:
|
||||
-- on_complete_primary_media_file_token,
|
||||
-- on_complete_primary_media_file_type,
|
||||
-- on_complete_batch_token,
|
||||
-- on_complete_primary_media_file_cdn_url,
|
||||
-- on_complete_primary_media_file_thumbnail_url_template,
|
||||
--
|
||||
|
||||
@@ -75,6 +76,10 @@ CREATE TABLE tasks (
|
||||
-- This will point to a collection of multiple files.
|
||||
on_complete_batch_token TEXT,
|
||||
|
||||
-- OPTIONAL.
|
||||
-- The URL to the media file.
|
||||
on_complete_primary_media_file_cdn_url TEXT,
|
||||
|
||||
-- OPTIONAL.
|
||||
-- The URL template for the thumbnail of the primary media file.
|
||||
on_complete_primary_media_file_thumbnail_url_template TEXT,
|
||||
|
||||
+3
@@ -148,6 +148,9 @@ async fn polling_loop(
|
||||
.as_ref()
|
||||
.map(|result| result.maybe_batch_token.as_ref())
|
||||
.flatten(),
|
||||
maybe_primary_media_file_cdn_url: job.maybe_result
|
||||
.as_ref()
|
||||
.map(|result| result.media_links.cdn_url.as_str()),
|
||||
maybe_primary_media_file_thumbnail_url_template: job.maybe_result
|
||||
.as_ref()
|
||||
.map(|result| result.media_links.maybe_thumbnail_template.as_deref())
|
||||
|
||||
@@ -27,6 +27,7 @@ pub struct TaskItem {
|
||||
pub on_complete_primary_media_file_token: Option<MediaFileToken>,
|
||||
pub on_complete_primary_media_file_type: Option<String>,
|
||||
pub on_complete_batch_token: Option<BatchGenerationToken>,
|
||||
pub on_complete_primary_media_file_cdn_url: Option<String>,
|
||||
pub on_complete_primary_media_file_thumbnail_url_template: Option<String>,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub updated_at: DateTime<Utc>,
|
||||
@@ -52,6 +53,7 @@ pub async fn list_tasks_for_frontend(
|
||||
on_complete_primary_media_file_token,
|
||||
on_complete_primary_media_file_type,
|
||||
on_complete_batch_token,
|
||||
on_complete_primary_media_file_cdn_url,
|
||||
on_complete_primary_media_file_thumbnail_url_template,
|
||||
created_at as "created_at: DateTime<Utc>",
|
||||
updated_at as "updated_at: DateTime<Utc>",
|
||||
@@ -85,6 +87,7 @@ pub async fn list_tasks_for_frontend(
|
||||
on_complete_primary_media_file_token: raw.on_complete_primary_media_file_token.map(|t| MediaFileToken::new_from_str(&t)),
|
||||
on_complete_primary_media_file_type: raw.on_complete_primary_media_file_type,
|
||||
on_complete_batch_token: raw.on_complete_batch_token.map(|t| BatchGenerationToken::new_from_str(&t)),
|
||||
on_complete_primary_media_file_cdn_url: raw.on_complete_primary_media_file_cdn_url,
|
||||
on_complete_primary_media_file_thumbnail_url_template: raw.on_complete_primary_media_file_thumbnail_url_template,
|
||||
created_at: raw.created_at,
|
||||
updated_at: raw.updated_at,
|
||||
@@ -110,6 +113,7 @@ struct TaskItemRaw {
|
||||
on_complete_primary_media_file_token: Option<String>,
|
||||
on_complete_primary_media_file_type: Option<String>,
|
||||
on_complete_batch_token: Option<String>,
|
||||
on_complete_primary_media_file_cdn_url: Option<String>,
|
||||
on_complete_primary_media_file_thumbnail_url_template: Option<String>,
|
||||
created_at: DateTime<Utc>,
|
||||
updated_at: DateTime<Utc>,
|
||||
|
||||
+3
@@ -12,6 +12,7 @@ pub struct UpdateSuccessfulTaskArgs<'a> {
|
||||
pub task_id: &'a TaskId,
|
||||
pub maybe_primary_media_file_token: Option<&'a MediaFileToken>,
|
||||
pub maybe_batch_token: Option<&'a BatchGenerationToken>,
|
||||
pub maybe_primary_media_file_cdn_url: Option<&'a str>,
|
||||
pub maybe_primary_media_file_thumbnail_url_template: Option<&'a str>,
|
||||
}
|
||||
|
||||
@@ -32,12 +33,14 @@ pub async fn update_successful_task_status_with_metadata(
|
||||
task_status = ?,
|
||||
on_complete_primary_media_file_token = ?,
|
||||
on_complete_batch_token = ?,
|
||||
on_complete_primary_media_file_cdn_url = ?,
|
||||
on_complete_primary_media_file_thumbnail_url_template = ?
|
||||
WHERE id = ?
|
||||
"#,
|
||||
SUCCESSFUL_STATUS,
|
||||
maybe_primary_media_token_temp,
|
||||
maybe_batch_token_temp,
|
||||
args.maybe_primary_media_file_cdn_url,
|
||||
args.maybe_primary_media_file_thumbnail_url_template,
|
||||
task_id_temp,
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user