From 2ec7d7a8a85cc12c07d20cfab9b90a78a7857eb6 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 12 Dec 2021 21:45:06 +0100 Subject: [PATCH] feat: save BlurHash from unsplash when selecting a photo from unsplash --- pkg/modules/background/unsplash/unsplash.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/modules/background/unsplash/unsplash.go b/pkg/modules/background/unsplash/unsplash.go index f097c6da0fc..60fd14ecfe9 100644 --- a/pkg/modules/background/unsplash/unsplash.go +++ b/pkg/modules/background/unsplash/unsplash.go @@ -61,6 +61,7 @@ type Photo struct { Height int `json:"height"` Color string `json:"color"` Description string `json:"description"` + BlurHash string `json:"blur_hash"` User struct { Username string `json:"username"` Name string `json:"name"` @@ -315,7 +316,7 @@ func (p *Provider) Set(s *xorm.Session, image *background.Image, list *models.Li list.BackgroundInformation = unsplashPhoto // Set it as the list background - return models.SetListBackground(s, list.ID, file) + return models.SetListBackground(s, list.ID, file, photo.BlurHash) } // Pingback pings the unsplash api if an unsplash photo has been accessed.