add stable media support and sync skillhub UI
This commit is contained in:
@@ -360,15 +360,31 @@ func buildArtifacts(record *job) []artifact {
|
||||
filename = inferFilenameFromRef(ref, buildArtifactID(record.JobID, idx))
|
||||
}
|
||||
contentType := defaultString(strings.TrimSpace(ref.ContentType), "application/octet-stream")
|
||||
storageStatus := strings.TrimSpace(ref.StorageStatus)
|
||||
if storageStatus == "" {
|
||||
switch {
|
||||
case ref.LocalPath != "":
|
||||
storageStatus = "ready"
|
||||
case ref.URL != "":
|
||||
storageStatus = "upstream"
|
||||
case ref.DataURL != "":
|
||||
storageStatus = "embedded"
|
||||
}
|
||||
}
|
||||
items = append(items, artifact{
|
||||
ID: buildArtifactID(record.JobID, idx),
|
||||
JobID: record.JobID,
|
||||
Filename: filename,
|
||||
ContentType: contentType,
|
||||
SizeBytes: ref.SizeBytes,
|
||||
CreatedAt: createdAt,
|
||||
ExpiresAt: expiresAt,
|
||||
Ref: ref,
|
||||
ID: buildArtifactID(record.JobID, idx),
|
||||
JobID: record.JobID,
|
||||
MediaID: strings.TrimSpace(ref.MediaID),
|
||||
Filename: filename,
|
||||
ContentType: contentType,
|
||||
SizeBytes: ref.SizeBytes,
|
||||
CreatedAt: createdAt,
|
||||
ExpiresAt: expiresAt,
|
||||
URL: strings.TrimSpace(ref.URL),
|
||||
Visibility: strings.TrimSpace(ref.Visibility),
|
||||
SHA256: strings.TrimSpace(ref.SHA256),
|
||||
StorageStatus: storageStatus,
|
||||
Ref: ref,
|
||||
})
|
||||
}
|
||||
return items
|
||||
|
||||
Reference in New Issue
Block a user