Skip to content

[ID3v2] Eager Loading for Text Frames#137

Merged
benrr101 merged 7 commits into
developfrom
feat/id3v2/text-frame-eager-loading
May 23, 2026
Merged

[ID3v2] Eager Loading for Text Frames#137
benrr101 merged 7 commits into
developfrom
feat/id3v2/text-frame-eager-loading

Conversation

@benrr101
Copy link
Copy Markdown
Owner

I'm really sleepy... 💤

Um, this makes text frames eagerly loaded, just like in #134. Tests were added and reworked.

🤖

Initial implementation was done via 🤖 , but it didn't get everything right, so there was a bunch of corrective work after the fact.

@benrr101 benrr101 added this to the v7.0.0 milestone May 23, 2026
@benrr101 benrr101 requested a review from Copilot May 23, 2026 17:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Switches TextInformationFrame and UserTextInformationFrame from lazy parsing of raw data to eager parsing at construction time (similar to PR #134 for URL frames). Removes the _rawData/_rawVersion deferred-parsing mechanism, splits UserTextInformationFrame to manage its own description/text fields independently, and rewrites renderFields to build output from the parsed fields rather than echoing raw data. A new ByteVector.join helper is added to support the rewrite, and tests are extensively reworked to cover the new behavior.

Changes:

  • Drop lazy raw-data parsing in text information frames; parse eagerly in parseFields and add dedicated parse/render in UserTextInformationFrame (with its own _description field).
  • Add ByteVector.join(separator, values) and corresponding tests.
  • Rework text frame tests for the eager model (constructor body bytes, parameterized cases for falsy values, multi-version render coverage) and add a findUserTextInformationFrame truthiness guard.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/id3v2/frames/textInformationFrame.ts Removes lazy raw-data fields; eager parseFields; rewrites renderFields for v3/v4; adds dedicated _description plus parse/render in UserTextInformationFrame.
src/byteVector.ts Adds ByteVector.join static helper; @TODO comment on get bounds check.
test-unit/byteVectorConstructorTests.ts Adds coverage for ByteVector.join (truthiness, empty, separator and value variations).
test-unit/id3v2/textInformationFrameTests.ts Rewrites parse/render tests around eager loading; adds parameterized invalid-version and empty/falsy render cases; covers toString.
test-unit/id3v2/userTextInformationFrameTests.ts Adds eager-parse tests (well-formed, ill-formed), description/text setters, find/render/toString coverage.
test-unit/id3v2/userUrlLinkFrameTests.ts Consolidates Latin1/UTF16 fromOffsetRawData tests into a parameterized case.
test-unit/id3v2/id3v2TagTests.ts Sets text on TYER test frame so it actually renders content after eager-loading change.
test-unit/id3v2/frameFactoryTests.ts Populates text on TCOM frame before render so the round-trip has content.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@benrr101 benrr101 merged commit 534dcf1 into develop May 23, 2026
5 checks passed
@benrr101 benrr101 deleted the feat/id3v2/text-frame-eager-loading branch May 23, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants