// Copies a tag. func (storage Storage) CopyTag(tx *Tx, sourceTagId entities.TagId, name string) (*entities.Tag, error) { if err := entities.ValidateTagName(name); err != nil { return nil, err } tag, err := database.InsertTag(tx.tx, name) if err != nil { return nil, err } err = database.CopyFileTags(tx.tx, sourceTagId, tag.Id) if err != nil { return nil, err } return tag, nil }
// Copies file tags from one tag to another. func (storage *Storage) CopyFileTags(tx *Tx, sourceTagId, destTagId entities.TagId) error { return database.CopyFileTags(tx.tx, sourceTagId, destTagId) }