Skip to content

Commit

Permalink
Use new 'medias' field for booru.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed May 8, 2022
1 parent 8b81d2a commit e092bdb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sites/Booru.io/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ const buildImage = (data: any): IImage => {
const img: IImage = Grabber.mapFields(data, map);
img.tags = Object.keys(data["tags"]);

const versions = [];
img.medias = [];
for (const key in data["transforms"]) {
const match = key.match(/width=(\d+):/);
if (match) {
versions.push({
size: parseInt(match[1], 10),
img.medias.push({
url: "/api/legacy/data/" + data["transforms"][key],
width: parseInt(match[1], 10),
});
}
}
Grabber.setImageLinks(img, versions);

return img;
};
Expand Down

0 comments on commit e092bdb

Please sign in to comment.