You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: studio.go
    path of file: ./repos/stash/internal/autotag
    
    the code of the file until where you have to start completion: package autotag

import (
	"context"

	"github.com/stashapp/stash/pkg/match"
	"github.com/stashapp/stash/pkg/models"
	"github.com/stashapp/stash/pkg/txn"
)

// the following 
    
func addImageStudio(ctx context.Context, imageWriter models.ImageUpdater, i *models.Image, studioID int) (bool, error) {
	// don't set if already set
	if i.StudioID != nil {
		return false, nil
	}

	// set the studio id
	imagePartial := models.NewImagePartial()
	imagePartial.StudioID = models.NewOptionalInt(studioID)

	if _, err := imageWriter.UpdatePartial(ctx, i.ID, imagePartial); err != nil {
		return false, err
	}
	return true, nil
}