forked from Shinonome/dots-hyprland
booru: fix messed up responses
This commit is contained in:
@@ -113,6 +113,7 @@ class BooruService extends Service {
|
||||
};
|
||||
let status = 0;
|
||||
// console.log(`${APISERVICES[this._mode].endpoint}?${paramString}`);
|
||||
|
||||
Utils.fetch(`${APISERVICES[this._mode].endpoint}?${paramString}`, options)
|
||||
.then(result => {
|
||||
status = result.status;
|
||||
@@ -122,7 +123,7 @@ class BooruService extends Service {
|
||||
// console.log(dataString);
|
||||
const parsedData = JSON.parse(dataString);
|
||||
// console.log(parsedData)
|
||||
this._responses.push(parsedData.map(obj => {
|
||||
this._responses[newMessageId] = parsedData.map(obj => {
|
||||
return {
|
||||
aspect_ratio: obj.width / obj.height,
|
||||
id: obj.id,
|
||||
@@ -140,7 +141,7 @@ class BooruService extends Service {
|
||||
file_height: obj.file_height,
|
||||
source: getWorkingImageSauce(obj.source),
|
||||
}
|
||||
}));
|
||||
});
|
||||
this.emit('updateResponse', newMessageId);
|
||||
})
|
||||
.catch(print);
|
||||
|
||||
Reference in New Issue
Block a user