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;
|
let status = 0;
|
||||||
// console.log(`${APISERVICES[this._mode].endpoint}?${paramString}`);
|
// console.log(`${APISERVICES[this._mode].endpoint}?${paramString}`);
|
||||||
|
|
||||||
Utils.fetch(`${APISERVICES[this._mode].endpoint}?${paramString}`, options)
|
Utils.fetch(`${APISERVICES[this._mode].endpoint}?${paramString}`, options)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
status = result.status;
|
status = result.status;
|
||||||
@@ -122,7 +123,7 @@ class BooruService extends Service {
|
|||||||
// console.log(dataString);
|
// console.log(dataString);
|
||||||
const parsedData = JSON.parse(dataString);
|
const parsedData = JSON.parse(dataString);
|
||||||
// console.log(parsedData)
|
// console.log(parsedData)
|
||||||
this._responses.push(parsedData.map(obj => {
|
this._responses[newMessageId] = parsedData.map(obj => {
|
||||||
return {
|
return {
|
||||||
aspect_ratio: obj.width / obj.height,
|
aspect_ratio: obj.width / obj.height,
|
||||||
id: obj.id,
|
id: obj.id,
|
||||||
@@ -140,7 +141,7 @@ class BooruService extends Service {
|
|||||||
file_height: obj.file_height,
|
file_height: obj.file_height,
|
||||||
source: getWorkingImageSauce(obj.source),
|
source: getWorkingImageSauce(obj.source),
|
||||||
}
|
}
|
||||||
}));
|
});
|
||||||
this.emit('updateResponse', newMessageId);
|
this.emit('updateResponse', newMessageId);
|
||||||
})
|
})
|
||||||
.catch(print);
|
.catch(print);
|
||||||
|
|||||||
Reference in New Issue
Block a user