From 4dc7d28696afaff6fe8045e34db97707516a074a Mon Sep 17 00:00:00 2001 From: wukko Date: Tue, 11 Feb 2025 15:42:16 +0600 Subject: [PATCH] api/instagram: fall back to photo in extractOldPost if video has no url --- api/src/processing/services/instagram.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/processing/services/instagram.js b/api/src/processing/services/instagram.js index eab4776e..9cc7dbdf 100644 --- a/api/src/processing/services/instagram.js +++ b/api/src/processing/services/instagram.js @@ -305,12 +305,12 @@ export default function instagram(obj) { if (sidecar) { const picker = sidecar.edges.filter(e => e.node?.display_url) .map((e, i) => { - const type = e.node?.is_video ? "video" : "photo"; + const type = e.node?.is_video && e.node?.video_url ? "video" : "photo"; let url; - if (type === 'video') { + if (type === "video") { url = e.node?.video_url; - } else if (type === 'photo') { + } else if (type === "photo") { url = e.node?.display_url; }