From a4a33708a1d7c8675a003fb04b34ff0eeac77502 Mon Sep 17 00:00:00 2001 From: shmyga Date: Thu, 16 Jan 2020 22:13:52 +0300 Subject: [PATCH] [update] PixabayStorage --- .../ru/m/puzzlez/storage/PixabayStorage.hx | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/haxe/ru/m/puzzlez/storage/PixabayStorage.hx b/src/haxe/ru/m/puzzlez/storage/PixabayStorage.hx index 48c8cea..8729f17 100644 --- a/src/haxe/ru/m/puzzlez/storage/PixabayStorage.hx +++ b/src/haxe/ru/m/puzzlez/storage/PixabayStorage.hx @@ -11,6 +11,28 @@ typedef PixabayResponse = { }> } +enum PixabayCategory { + FASHION; + NATURE; + BACKGROUNDS; + SCIENCE; + EDUCATION; + PEOPLE; + FEELINGS; + RELIGION; + HEALTH; + PLACES; + ANIMALS; + INDUSTRY; + FOOD; + COMPUTER; + SPORTS; + TRANSPORTATION; + TRAVEL; BUILDINGS; + BUSINESS; + MUSIC; +} + @:provide class PixabayStorage extends SharedObjectStorage implements ISourceStorage { private var key:String; @@ -26,7 +48,7 @@ typedef PixabayResponse = { return enabled && exists(type) ? Promise.promise(read(type)) : new JsonLoader() - .GET('https://pixabay.com/api/?key=${key}&category=${type}') + .GET('https://pixabay.com/api/?key=${key}&q=${type}') .then(function(result:PixabayResponse) { var result = [for (item in result.hits) URL(item.largeImageURL)]; if (enabled) {