Make MP3 next frame location more strict for better recovery (fixes #382), fix Date timezone for ID3 tags

This commit is contained in:
Vanilagy
2026-05-22 11:31:26 +02:00
parent 149a2b4571
commit 85a80972a0
9 changed files with 70 additions and 26 deletions
+2 -2
View File
@@ -93,7 +93,7 @@ export const parseId3V1Tag = (slice: FileSlice, tags: MetadataTags) => {
const yearText = readId3V1String(slice, 4);
const year = Number.parseInt(yearText, 10);
if (Number.isInteger(year) && year > 0) {
tags.date ??= new Date(year, 0, 1);
tags.date ??= new Date(String(year)); // String so that it parses as UTC
}
const commentBytes = readBytes(slice, 30);
@@ -339,7 +339,7 @@ export const parseId3V2Tag = (slice: FileSlice, header: Id3V2Header, tags: Metad
const year = Number.parseInt(yearText, 10);
if (Number.isInteger(year)) {
tags.date ??= new Date(year, 0, 1);
tags.date ??= new Date(String(year)); // String so that it parses as UTC
}
}; break;