Add Studio Code and Photographer to Galleries. (#4195)

* Added Studio Code and Photographer to Galleries
* Fix gallery display on mobile
* Fixed potential panic when scraping with a bad configuration
---------
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
bob123491234
2023-11-27 22:05:33 -06:00
committed by GitHub
parent b78771dbcd
commit d1018b4c5d
25 changed files with 243 additions and 102 deletions

View File

@@ -43,7 +43,9 @@ func (r *mutationResolver) GalleryCreate(ctx context.Context, input GalleryCreat
newGallery := models.NewGallery()
newGallery.Title = input.Title
newGallery.Code = translator.string(input.Code)
newGallery.Details = translator.string(input.Details)
newGallery.Photographer = translator.string(input.Photographer)
newGallery.Rating = input.Rating100
var err error
@@ -182,7 +184,9 @@ func (r *mutationResolver) galleryUpdate(ctx context.Context, input models.Galle
updatedGallery.Title = models.NewOptionalString(*input.Title)
}
updatedGallery.Code = translator.optionalString(input.Code, "code")
updatedGallery.Details = translator.optionalString(input.Details, "details")
updatedGallery.Photographer = translator.optionalString(input.Photographer, "photographer")
updatedGallery.Rating = translator.optionalInt(input.Rating100, "rating100")
updatedGallery.Organized = translator.optionalBool(input.Organized, "organized")
@@ -257,7 +261,9 @@ func (r *mutationResolver) BulkGalleryUpdate(ctx context.Context, input BulkGall
// Populate gallery from the input
updatedGallery := models.NewGalleryPartial()
updatedGallery.Code = translator.optionalString(input.Code, "code")
updatedGallery.Details = translator.optionalString(input.Details, "details")
updatedGallery.Photographer = translator.optionalString(input.Photographer, "photographer")
updatedGallery.Rating = translator.optionalInt(input.Rating100, "rating100")
updatedGallery.Organized = translator.optionalBool(input.Organized, "organized")
updatedGallery.URLs = translator.optionalURLsBulk(input.Urls, input.URL)