fix(canvas): 分镜视频生成 - 正确附加角色场景与声音资产及镜头台词
This commit is contained in:
1 parent
37eb2b7e48
commit
f2fe163bc7
9 files changed
+266
-27
No files matched your search
@@ -109,6 +109,27 @@ func (r *Repository) ProjectUnitShotAssetReferences(projectID string, unitID str
|
||||
return references, err
|
||||
}
|
||||
|
||||
func (r *Repository) ProjectAssetVersionsByIDs(projectID string, versionIDs []string) ([]model.AssetVersion, error) {
|
||||
if len(versionIDs) == 0 {
|
||||
return []model.AssetVersion{}, nil
|
||||
}
|
||||
var versions []model.AssetVersion
|
||||
err := r.db.Table("asset_versions").Select("asset_versions.*").
|
||||
Joins("JOIN project_asset_links ON project_asset_links.asset_id = asset_versions.asset_id").
|
||||
Where("project_asset_links.project_id = ? AND asset_versions.id IN ?", projectID, versionIDs).
|
||||
Find(&versions).Error
|
||||
return versions, err
|
||||
}
|
||||
|
||||
func (r *Repository) AssetRepresentationsByVersionIDs(versionIDs []string) ([]model.AssetRepresentation, error) {
|
||||
if len(versionIDs) == 0 {
|
||||
return []model.AssetRepresentation{}, nil
|
||||
}
|
||||
var representations []model.AssetRepresentation
|
||||
err := r.db.Where("asset_version_id IN ?", versionIDs).Order("asset_version_id asc, role asc, created_at asc").Find(&representations).Error
|
||||
return representations, err
|
||||
}
|
||||
|
||||
func (r *Repository) ProjectUnitAssetCandidates(projectID string, unitID string) ([]model.ProjectAssetCandidate, error) {
|
||||
var candidates []model.ProjectAssetCandidate
|
||||
err := r.db.Where("project_id = ? AND (unit_id = ? OR unit_id = '')", projectID, unitID).Order("created_at asc").Find(&candidates).Error
|
||||
|
||||
Reference in new issue
Block a user