From 1f51597596863f13381f8102bae105162504fd24 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Fri, 21 Feb 2020 21:50:08 +0100 Subject: [PATCH] use image type field if available --- index.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 7286f3c..0c2fdea 100644 --- a/index.js +++ b/index.js @@ -349,22 +349,22 @@ function updateImages(version, commit, model, url, mobj, is_custom) { images.sort(); for (var i in images) { - var image = images[i].name; - var lc = image.toLowerCase() + var type = images[i].type || images[i].name; + var lc = type.toLowerCase() if (lc.includes('factory')) { - entries['FACTORY'].push(image); + entries['FACTORY'].push(type); } else if (lc.includes('sysupgrade')) { - entries['SYSUPGRADE'].push(image); + entries['SYSUPGRADE'].push(type); } else if (lc.includes('kernel') || lc.includes('zimage') || lc.includes('uimage')) { - entries['KERNEL'].push(image); + entries['KERNEL'].push(type); } else if (lc.includes('rootfs')) { - entries['ROOTFS'].push(image); + entries['ROOTFS'].push(type); } else if (lc.includes('sdcard')) { - entries['SDCARD'].push(image); + entries['SDCARD'].push(type); } else if (lc.includes('tftp')) { - entries['TFTP'].push(image); + entries['TFTP'].push(type); } else { - entries['OTHER'].push(image); + entries['OTHER'].push(type); } } -- 2.30.2