Ran formatter and fixed some lint issues

This commit is contained in:
Stash Dev
2019-02-14 14:53:32 -08:00
parent 14df7b0700
commit 1d00b2b36f
97 changed files with 709 additions and 642 deletions

View File

@@ -20,60 +20,60 @@ func (r *mutationResolver) PerformerCreate(ctx context.Context, input models.Per
// Populate a new performer from the input
currentTime := time.Now()
newPerformer := models.Performer{
Image: imageData,
Checksum: checksum,
CreatedAt: models.SQLiteTimestamp{ Timestamp: currentTime },
UpdatedAt: models.SQLiteTimestamp{ Timestamp: currentTime },
Image: imageData,
Checksum: checksum,
CreatedAt: models.SQLiteTimestamp{Timestamp: currentTime},
UpdatedAt: models.SQLiteTimestamp{Timestamp: currentTime},
}
if input.Name != nil {
newPerformer.Name = sql.NullString{ String: *input.Name, Valid: true }
newPerformer.Name = sql.NullString{String: *input.Name, Valid: true}
}
if input.URL != nil {
newPerformer.Url = sql.NullString{ String: *input.URL, Valid: true }
newPerformer.URL = sql.NullString{String: *input.URL, Valid: true}
}
if input.Birthdate != nil {
newPerformer.Birthdate = sql.NullString{ String: *input.Birthdate, Valid: true }
newPerformer.Birthdate = sql.NullString{String: *input.Birthdate, Valid: true}
}
if input.Ethnicity != nil {
newPerformer.Ethnicity = sql.NullString{ String: *input.Ethnicity, Valid: true }
newPerformer.Ethnicity = sql.NullString{String: *input.Ethnicity, Valid: true}
}
if input.Country != nil {
newPerformer.Country = sql.NullString{ String: *input.Country, Valid: true }
newPerformer.Country = sql.NullString{String: *input.Country, Valid: true}
}
if input.EyeColor != nil {
newPerformer.EyeColor = sql.NullString{ String: *input.EyeColor, Valid: true }
newPerformer.EyeColor = sql.NullString{String: *input.EyeColor, Valid: true}
}
if input.Height != nil {
newPerformer.Height = sql.NullString{ String: *input.Height, Valid: true }
newPerformer.Height = sql.NullString{String: *input.Height, Valid: true}
}
if input.Measurements != nil {
newPerformer.Measurements = sql.NullString{ String: *input.Measurements, Valid: true }
newPerformer.Measurements = sql.NullString{String: *input.Measurements, Valid: true}
}
if input.FakeTits != nil {
newPerformer.FakeTits = sql.NullString{ String: *input.FakeTits, Valid: true }
newPerformer.FakeTits = sql.NullString{String: *input.FakeTits, Valid: true}
}
if input.CareerLength != nil {
newPerformer.CareerLength = sql.NullString{ String: *input.CareerLength, Valid: true }
newPerformer.CareerLength = sql.NullString{String: *input.CareerLength, Valid: true}
}
if input.Tattoos != nil {
newPerformer.Tattoos = sql.NullString{ String: *input.Tattoos, Valid: true }
newPerformer.Tattoos = sql.NullString{String: *input.Tattoos, Valid: true}
}
if input.Piercings != nil {
newPerformer.Piercings = sql.NullString{ String: *input.Piercings, Valid: true }
newPerformer.Piercings = sql.NullString{String: *input.Piercings, Valid: true}
}
if input.Aliases != nil {
newPerformer.Aliases = sql.NullString{ String: *input.Aliases, Valid: true }
newPerformer.Aliases = sql.NullString{String: *input.Aliases, Valid: true}
}
if input.Twitter != nil {
newPerformer.Twitter = sql.NullString{ String: *input.Twitter, Valid: true }
newPerformer.Twitter = sql.NullString{String: *input.Twitter, Valid: true}
}
if input.Instagram != nil {
newPerformer.Instagram = sql.NullString{ String: *input.Instagram, Valid: true }
newPerformer.Instagram = sql.NullString{String: *input.Instagram, Valid: true}
}
if input.Favorite != nil {
newPerformer.Favorite = sql.NullBool{ Bool: *input.Favorite, Valid: true }
newPerformer.Favorite = sql.NullBool{Bool: *input.Favorite, Valid: true}
} else {
newPerformer.Favorite = sql.NullBool{ Bool: false, Valid: true }
newPerformer.Favorite = sql.NullBool{Bool: false, Valid: true}
}
// Start the transaction and save the performer
@@ -97,8 +97,8 @@ func (r *mutationResolver) PerformerUpdate(ctx context.Context, input models.Per
// Populate performer from the input
performerID, _ := strconv.Atoi(input.ID)
updatedPerformer := models.Performer{
ID: performerID,
UpdatedAt: models.SQLiteTimestamp{ Timestamp: time.Now() },
ID: performerID,
UpdatedAt: models.SQLiteTimestamp{Timestamp: time.Now()},
}
if input.Image != nil {
checksum, imageData, err := utils.ProcessBase64Image(*input.Image)
@@ -109,54 +109,54 @@ func (r *mutationResolver) PerformerUpdate(ctx context.Context, input models.Per
updatedPerformer.Checksum = checksum
}
if input.Name != nil {
updatedPerformer.Name = sql.NullString{ String: *input.Name, Valid: true }
updatedPerformer.Name = sql.NullString{String: *input.Name, Valid: true}
}
if input.URL != nil {
updatedPerformer.Url = sql.NullString{ String: *input.URL, Valid: true }
updatedPerformer.URL = sql.NullString{String: *input.URL, Valid: true}
}
if input.Birthdate != nil {
updatedPerformer.Birthdate = sql.NullString{ String: *input.Birthdate, Valid: true }
updatedPerformer.Birthdate = sql.NullString{String: *input.Birthdate, Valid: true}
}
if input.Ethnicity != nil {
updatedPerformer.Ethnicity = sql.NullString{ String: *input.Ethnicity, Valid: true }
updatedPerformer.Ethnicity = sql.NullString{String: *input.Ethnicity, Valid: true}
}
if input.Country != nil {
updatedPerformer.Country = sql.NullString{ String: *input.Country, Valid: true }
updatedPerformer.Country = sql.NullString{String: *input.Country, Valid: true}
}
if input.EyeColor != nil {
updatedPerformer.EyeColor = sql.NullString{ String: *input.EyeColor, Valid: true }
updatedPerformer.EyeColor = sql.NullString{String: *input.EyeColor, Valid: true}
}
if input.Height != nil {
updatedPerformer.Height = sql.NullString{ String: *input.Height, Valid: true }
updatedPerformer.Height = sql.NullString{String: *input.Height, Valid: true}
}
if input.Measurements != nil {
updatedPerformer.Measurements = sql.NullString{ String: *input.Measurements, Valid: true }
updatedPerformer.Measurements = sql.NullString{String: *input.Measurements, Valid: true}
}
if input.FakeTits != nil {
updatedPerformer.FakeTits = sql.NullString{ String: *input.FakeTits, Valid: true }
updatedPerformer.FakeTits = sql.NullString{String: *input.FakeTits, Valid: true}
}
if input.CareerLength != nil {
updatedPerformer.CareerLength = sql.NullString{ String: *input.CareerLength, Valid: true }
updatedPerformer.CareerLength = sql.NullString{String: *input.CareerLength, Valid: true}
}
if input.Tattoos != nil {
updatedPerformer.Tattoos = sql.NullString{ String: *input.Tattoos, Valid: true }
updatedPerformer.Tattoos = sql.NullString{String: *input.Tattoos, Valid: true}
}
if input.Piercings != nil {
updatedPerformer.Piercings = sql.NullString{ String: *input.Piercings, Valid: true }
updatedPerformer.Piercings = sql.NullString{String: *input.Piercings, Valid: true}
}
if input.Aliases != nil {
updatedPerformer.Aliases = sql.NullString{ String: *input.Aliases, Valid: true }
updatedPerformer.Aliases = sql.NullString{String: *input.Aliases, Valid: true}
}
if input.Twitter != nil {
updatedPerformer.Twitter = sql.NullString{ String: *input.Twitter, Valid: true }
updatedPerformer.Twitter = sql.NullString{String: *input.Twitter, Valid: true}
}
if input.Instagram != nil {
updatedPerformer.Instagram = sql.NullString{ String: *input.Instagram, Valid: true }
updatedPerformer.Instagram = sql.NullString{String: *input.Instagram, Valid: true}
}
if input.Favorite != nil {
updatedPerformer.Favorite = sql.NullBool{ Bool: *input.Favorite, Valid: true }
updatedPerformer.Favorite = sql.NullBool{Bool: *input.Favorite, Valid: true}
} else {
updatedPerformer.Favorite = sql.NullBool{ Bool: false, Valid: true }
updatedPerformer.Favorite = sql.NullBool{Bool: false, Valid: true}
}
// Start the transaction and save the performer
@@ -174,4 +174,4 @@ func (r *mutationResolver) PerformerUpdate(ctx context.Context, input models.Per
}
return performer, nil
}
}