feat: return BlurHash for unsplash search results
This commit is contained in:
parent
2ec7d7a8a8
commit
6df865876d
2 changed files with 7 additions and 5 deletions
|
@ -27,6 +27,7 @@ type Image struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
Thumb string `json:"thumb,omitempty"`
|
Thumb string `json:"thumb,omitempty"`
|
||||||
|
BlurHash string `json:"blur_hash"`
|
||||||
// This can be used to supply extra information from an image provider to clients
|
// This can be used to supply extra information from an image provider to clients
|
||||||
Info interface{} `json:"info,omitempty"`
|
Info interface{} `json:"info,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -181,6 +181,7 @@ func (p *Provider) Search(s *xorm.Session, search string, page int64) (result []
|
||||||
result = append(result, &background.Image{
|
result = append(result, &background.Image{
|
||||||
ID: p.ID,
|
ID: p.ID,
|
||||||
URL: getImageID(p.Urls.Raw),
|
URL: getImageID(p.Urls.Raw),
|
||||||
|
BlurHash: p.BlurHash,
|
||||||
Info: &models.UnsplashPhoto{
|
Info: &models.UnsplashPhoto{
|
||||||
UnsplashID: p.ID,
|
UnsplashID: p.ID,
|
||||||
Author: p.User.Username,
|
Author: p.User.Username,
|
||||||
|
|
Loading…
Add table
Reference in a new issue