|
|
@ -129,16 +129,9 @@ func UpdateRelease(rel *Release) error {
|
|
|
|
// AddReleaseAttachments adds a release attachments
|
|
|
|
// AddReleaseAttachments adds a release attachments
|
|
|
|
func AddReleaseAttachments(releaseID int64, attachmentUUIDs []string) (err error) {
|
|
|
|
func AddReleaseAttachments(releaseID int64, attachmentUUIDs []string) (err error) {
|
|
|
|
// Check attachments
|
|
|
|
// Check attachments
|
|
|
|
var attachments = make([]*Attachment, 0)
|
|
|
|
attachments, err := GetAttachmentsByUUIDs(attachmentUUIDs)
|
|
|
|
for _, uuid := range attachmentUUIDs {
|
|
|
|
if err != nil {
|
|
|
|
attach, err := getAttachmentByUUID(x, uuid)
|
|
|
|
return fmt.Errorf("GetAttachmentsByUUIDs [uuids: %v]: %v", attachmentUUIDs, err)
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
if IsErrAttachmentNotExist(err) {
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Errorf("getAttachmentByUUID [%s]: %v", uuid, err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
attachments = append(attachments, attach)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for i := range attachments {
|
|
|
|
for i := range attachments {
|
|
|
|