mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
fix(scanner): handle legacy Book Dock series indexes
Normalize numeric JSON snapshots at the Book Dock boundary and reject malformed runtime values without aborting filing. Closes #1241
This commit is contained in:
@@ -48,8 +48,9 @@ export function compareSeriesIndices(a: SeriesIndex, b: SeriesIndex): number {
|
||||
}
|
||||
|
||||
export function formatSeriesIndex(value: SeriesIndex | null): string | null {
|
||||
if (value == null) return null;
|
||||
const [whole, fraction] = value.split(".");
|
||||
const parsed = parseSeriesIndex(value);
|
||||
if (parsed == null) return null;
|
||||
const [whole, fraction] = parsed.split(".");
|
||||
const padded = whole.padStart(2, "0");
|
||||
return fraction === undefined ? padded : `${padded}.${fraction}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user