From bc0216f83205ff2c1815e38ccfff4ded0ed1cdf4 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Thu, 20 Mar 2025 23:01:48 -0500 Subject: [PATCH] Account of screen modifier 'A' in sony models --- .vscode/settings.json | 1 + __tests__/camera.test.ts | 2 ++ src/platforms/sony.ts | 7 +++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e3b8a76d..5ef0cd4d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -27,6 +27,7 @@ "headlessui", "hgetall", "hset", + "IIIA", "ILCE", "ILIKE", "ILME", diff --git a/__tests__/camera.test.ts b/__tests__/camera.test.ts index fa5fb08d..6bdacae6 100644 --- a/__tests__/camera.test.ts +++ b/__tests__/camera.test.ts @@ -20,7 +20,9 @@ export const SONY_CAMERAS = { 'SONY ILCE-9': 'Sony A9', 'SONY ILCE-7RM5': 'Sony A7R V', 'SONY ILCE-7RM4': 'Sony A7R IV', + 'SONY ILCE-7RM4A': 'Sony A7R IVA', 'SONY ILCE-7RM3': 'Sony A7R III', + 'SONY ILCE-7RM3A': 'Sony A7R IIIA', 'SONY ILCE-7RM2': 'Sony A7R II', 'SONY ILCE-7R': 'Sony A7R', 'SONY ILCE-7SM3': 'Sony A7S III', diff --git a/src/platforms/sony.ts b/src/platforms/sony.ts index a9584794..13d8649e 100644 --- a/src/platforms/sony.ts +++ b/src/platforms/sony.ts @@ -12,14 +12,17 @@ export const formatSonyModel = (model: string) => { series, letter, _version, - ] = /^SONY (ILCE|ILME)-([0-9]*)([a-ln-z]*)M*([0-9]*)/gi.exec(model) ?? []; + modifier, + // eslint-disable-next-line max-len + ] = /^SONY (ILCE|ILME)-([0-9]*)([a-ln-z]*)M*([0-9]*)([a-z]*)/gi.exec(model) ?? []; const version = parseInt(_version ?? '0'); const versionRomanNumber = version > 1 && version < 10 ? ` ${convertNumberToRomanNumeral(version)}` : undefined; if (type === 'ILCE' || type === 'ILME') { return type === 'ILCE' - ? `A${series}${letter}${versionRomanNumber || version || ''}` + // eslint-disable-next-line max-len + ? `A${series}${letter}${versionRomanNumber || version || ''}${modifier || ''}` : `FX${series}${_version}`; } return model;