Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,27 @@ const MEDIA_URL_LOOKUPS: usize = 4;
/// Time to resolve missing URLs in one asset list response.
const ASSET_LIST_URL_BUDGET: Duration = Duration::from_secs(10);

/// Normalized media variant entry from tile or scene clip history.
#[derive(Debug, Clone, Deserialize)]
pub(crate) struct FlowAssetVariant {
/// Variant media ID.
pub(crate) id: String,
/// Lowercase variant generation status (`"pending"`, `"scheduled"`, `"success"`, `"failed"`, or `"canceled"`).
#[serde(default)]
pub(crate) status: Option<String>,
/// Failure description when variant generation failed or canceled.
#[serde(default)]
pub(crate) error: Option<String>,
/// Resolved media URL when the variant completed.
#[serde(default)]
pub(crate) url: Option<String>,
/// Generation prompt text for the variant when present.
#[serde(default)]
pub(crate) prompt: Option<String>,
}

/// Media asset or scene item inside a Google Flow project.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub(crate) struct FlowAsset {
/// Flow asset or tile ID.
pub(crate) id: String,
Expand Down Expand Up @@ -60,6 +79,15 @@ pub(crate) struct FlowAsset {
/// Primary media ID for video trim and edit operations.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub(crate) primary_media_id: Option<String>,
/// Parent scene ID when this video clip belongs to a scene.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub(crate) scene_id: Option<String>,
/// Ordered clip workflow IDs when this asset is a scene tile.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub(crate) clip_ids: Option<Vec<String>>,
/// Internal normalized variant history used to detect edit completions and failures.
#[serde(default, skip_serializing)]
pub(crate) variants: Vec<FlowAssetVariant>,
/// Character personality notes or introduction text.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub(crate) personality_notes: Option<String>,
Expand Down
14 changes: 1 addition & 13 deletions src/characters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,21 +761,9 @@ pub(crate) async fn create_or_update_character_job(
id: media_id.clone().unwrap_or_else(|| char_id.clone()),
name: persisted_name.clone(),
kind: "image".to_string(),
prompt: None,
url: src,
collection_id: None,
collection_name: None,
width: None,
height: None,
duration: None,
primary_media_id: media_id,
personality_notes: None,
voice: None,
trim_start_seconds: None,
trim_end_seconds: None,
media_status: None,
media_error: None,
created_at: None,
..FlowAsset::default()
};
if let Ok(rec) = download_resolved_asset(
engine,
Expand Down
Loading
Loading