func createStudios(sqb models.StudioReaderWriter, n int, o int) error {
	const namePlain = "Name"
	const nameNoCase = "NaMe"

	for i := 0; i < n+o; i++ {
		index := i
		name := namePlain

		if i >= n { // i<n studios get normal names
			name = nameNoCase       // i>=n studios get dup names if case is not checked
			index = n + o - (i + 1) // for the name to be the same the number (index) must be the same also
		} // so count backwards to 0 as needed
		// studios [ i ] and [ n + o - i - 1  ] should have similar names with only the Name!=NaMe part different

		name = getStudioStringValue(index, name)
		studio := models.Studio{
			Name:          sql.NullString{String: name, Valid: true},
			Checksum:      md5.FromString(name),
			URL:           getStudioNullStringValue(index, urlField),
			IgnoreAutoTag: getIgnoreAutoTag(i),
		}
		created, err := createStudioFromModel(sqb, studio)

		if err != nil {
			return err
		}

		// add alias
		alias := getStudioStringValue(i, "Alias")
		if err := sqb.UpdateAliases(created.ID, []string{alias}); err != nil {
			return fmt.Errorf("error setting studio alias: %s", err.Error())
		}

		studioIDs = append(studioIDs, created.ID)
		studioNames = append(studioNames, created.Name.String)
	}

	return nil
}
// createStudios creates n studios with plain Name and o studios with camel cased NaMe included
createStudios creates n studios with plain Name and o studios with camel cased NaMe included
// createStudios creates n studios with plain Name and o studios with camel cased NaMe included
func createStudios(sqb models.StudioReaderWriter, n int, o int) error {
	const namePlain = "Name"
	const nameNoCase = "NaMe"
	for i := 0; i < n+o; i++ {
		index := i
		name := namePlain
		if i >= n { 
			name = nameNoCase       
			index = n + o - (i + 1) 
		} 
		name = getStudioStringValue(index, name)
		studio := models.Studio{
			Name:          sql.NullString{String: name, Valid: true},
			Checksum:      md5.FromString(name),
			URL:           getStudioNullStringValue(index, urlField),
			IgnoreAutoTag: getIgnoreAutoTag(i),
		}
		created, err := createStudioFromModel(sqb, studio)
		if err != nil {
			return err
		}
		alias := getStudioStringValue(i, "Alias")
		if err := sqb.UpdateAliases(created.ID, []string{alias}); err != nil {
			return fmt.Errorf("error setting studio alias: %s", err.Error())
		}
		studioIDs = append(studioIDs, created.ID)
		studioNames = append(studioNames, created.Name.String)
	}
	return nil
}
func createStudios ( sqb models . StudioReaderWriter , n int , o int ) error { const namePlain = " " const nameNoCase = " " for i := 0 ; i < n + o ; i ++ { index := i name := namePlain if i >= n { name = nameNoCase index = n + o - ( i + 1 ) } name = getStudioStringValue ( index , name ) studio := models . Studio { Name : sql . NullString { String : name , Valid : true } , Checksum : md5 . FromString ( name ) , URL : getStudioNullStringValue ( index , urlField ) , IgnoreAutoTag : getIgnoreAutoTag ( i ) , } created , err := createStudioFromModel ( sqb , studio ) if err != nil { return err } alias := getStudioStringValue ( i , " " ) if err := sqb . UpdateAliases ( created . ID , [ ] string { alias } ) ; err != nil { return fmt . Errorf ( " " , err . Error ( ) ) } studioIDs = append ( studioIDs , created . ID ) studioNames = append ( studioNames , created . Name . String ) } return nil }
createStudios creates n studios with plain Name and o studios with camel cased NaMe included
createStudios creates n studios with plain Name and o studios with camel cased NaMe included
// i<n studios get normal names // i>=n studios get dup names if case is not checked // for the name to be the same the number (index) must be the same also // so count backwards to 0 as needed // studios [ i ] and [ n + o - i - 1  ] should have similar names with only the Name!=NaMe part different // add alias