From fb5d68a8308bd2d8dbf2e8c8efd2183f70944b63 Mon Sep 17 00:00:00 2001 From: wukko Date: Thu, 22 Aug 2024 18:02:53 +0600 Subject: [PATCH] api/instagram: add file name for proxied image thumbs --- api/src/processing/services/instagram.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/src/processing/services/instagram.js b/api/src/processing/services/instagram.js index 66c1ad23..2dfe98ea 100644 --- a/api/src/processing/services/instagram.js +++ b/api/src/processing/services/instagram.js @@ -167,7 +167,7 @@ export default function(obj) { const sidecar = data?.gql_data?.shortcode_media?.edge_sidecar_to_children; if (sidecar) { const picker = sidecar.edges.filter(e => e.node?.display_url) - .map(e => { + .map((e, i) => { const type = e.node?.is_video ? "video" : "photo"; const url = type === "video" ? e.node?.video_url : e.node?.display_url; @@ -179,7 +179,7 @@ export default function(obj) { service: "instagram", type: "proxy", u: e.node?.display_url, - filename: "image.jpg" + filename: `instagram_${id}_${i + 1}.jpg` }) } }); @@ -203,7 +203,7 @@ export default function(obj) { const carousel = data.carousel_media; if (carousel) { const picker = carousel.filter(e => e?.image_versions2) - .map(e => { + .map((e, i) => { const type = e.video_versions ? "video" : "photo"; const imageUrl = e.image_versions2.candidates[0].url; @@ -221,7 +221,7 @@ export default function(obj) { service: "instagram", type: "proxy", u: imageUrl, - filename: "image.jpg" + filename: `instagram_${id}_${i + 1}.jpg` }) } });