From b2888e32cf22bb8ccd7ccee25d7c45596cb6e7e8 Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Thu, 19 Mar 2026 12:22:45 +0100 Subject: [PATCH] Check FW >= 4.6 and < 5.x --- web/public/js/kobo-device.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/web/public/js/kobo-device.js b/web/public/js/kobo-device.js index fce0763..0a7058e 100644 --- a/web/public/js/kobo-device.js +++ b/web/public/js/kobo-device.js @@ -53,11 +53,6 @@ var FIRMWARE_DOWNLOADS = { }, }; -/** - * Supported firmware versions for patching (derived from FIRMWARE_DOWNLOADS). - */ -const SUPPORTED_FIRMWARE = Object.keys(FIRMWARE_DOWNLOADS); - /** * Get the firmware download URL for a given serial prefix and firmware version. * Returns null if no URL is available. @@ -153,8 +148,10 @@ class KoboDevice { ? serial.substring(0, 4) : serial.substring(0, 3); const model = KOBO_MODELS[serialPrefix] || 'Unknown Kobo (' + serial.substring(0, 4) + ')'; - const isSupported = SUPPORTED_FIRMWARE.includes(firmware); - const isIncompatible = firmware.startsWith('5.'); + const fwParts = firmware.split('.'); + const fwMajor = parseInt(fwParts[0], 10) || 0; + const fwMinor = parseInt(fwParts[1], 10) || 0; + const isIncompatible = !(fwMajor === 4 && fwMinor >= 6); return { serial, @@ -162,7 +159,6 @@ class KoboDevice { firmware, hardwareId, model, - isSupported, isIncompatible, }; }