[update] (pixabay) update query
This commit is contained in:
@@ -63,7 +63,7 @@ class PixabaySource implements IImageSource<PixabayCategory> {
|
|||||||
|
|
||||||
public function getList(?type:PixabayCategory):Promise<Array<ImageId>> {
|
public function getList(?type:PixabayCategory):Promise<Array<ImageId>> {
|
||||||
return new JsonLoader<PixabayResponse>()
|
return new JsonLoader<PixabayResponse>()
|
||||||
.GET('${baseUrl}?key=${key}&category=${type}&image_type=${PixabayImageType.PHOTO}')
|
.GET('${baseUrl}?key=${key}&category=${type}&image_type=${PixabayImageType.PHOTO}&editors_choice=true')
|
||||||
.then((response:PixabayResponse) -> {
|
.then((response:PixabayResponse) -> {
|
||||||
var result = [];
|
var result = [];
|
||||||
for (item in response.hits) {
|
for (item in response.hits) {
|
||||||
@@ -86,6 +86,6 @@ class PixabaySource implements IImageSource<PixabayCategory> {
|
|||||||
|
|
||||||
public function loadImage(id:ImageId, preview:Bool = false):Promise<BitmapData> {
|
public function loadImage(id:ImageId, preview:Bool = false):Promise<BitmapData> {
|
||||||
return getImage(id)
|
return getImage(id)
|
||||||
.pipe((data:PixabayImage) -> return new ImageLoader().GET(preview ? data.previewURL : data.largeImageURL));
|
.pipe((data:PixabayImage) -> return new ImageLoader().GET(preview ? data.webformatURL : data.largeImageURL));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user