mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-30 04:13:51 +02:00
Make MP3 next frame location more strict for better recovery (fixes #382), fix Date timezone for ID3 tags
This commit is contained in:
+2
-2
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user