Skip to content

Commit

Permalink
galleries import/export photographer field
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyAxolotl committed Nov 2, 2022
1 parent 8e93591 commit 7eb81a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/gallery/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ import (
// does not convert the relationships to other objects.
func ToBasicJSON(gallery *models.Gallery) (*jsonschema.Gallery, error) {
newGalleryJSON := jsonschema.Gallery{
Title: gallery.Title,
URL: gallery.URL,
Details: gallery.Details,
CreatedAt: json.JSONTime{Time: gallery.CreatedAt},
UpdatedAt: json.JSONTime{Time: gallery.UpdatedAt},
Title: gallery.Title,
URL: gallery.URL,
Details: gallery.Details,
Photographer: gallery.Photographer,
CreatedAt: json.JSONTime{Time: gallery.CreatedAt},
UpdatedAt: json.JSONTime{Time: gallery.UpdatedAt},
}

if gallery.FolderID != nil {
Expand Down
3 changes: 3 additions & 0 deletions pkg/gallery/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ func (i *Importer) galleryJSONToGallery(galleryJSON jsonschema.Gallery) models.G
if galleryJSON.Details != "" {
newGallery.Details = galleryJSON.Details
}
if galleryJSON.Photographer != "" {
newGallery.Photographer = galleryJSON.Photographer
}
if galleryJSON.URL != "" {
newGallery.URL = galleryJSON.URL
}
Expand Down

0 comments on commit 7eb81a0

Please sign in to comment.