fix(feeds): preserve fractional media rates and durations

AS
2d ago
+64-5

Media RSS numeric attributes currently use parseInt, so samplingrate="44.1" becomes 44 and framerate="29.97" becomes 29. The Media RSS specification includes a 44.1 kHz sampling-rate example.

Parse bitrate, frame rate, sampling rate and duration as floating-point numbers. File sizes, channel counts and image dimensions retain integer parsing. Add RSS and Atom regressions for fractional values, zero values and omitted attributes.

Validation on Windows with Node 24.22.0:

  • New feed tests against the original source: 2 failed, 7 passed; both failures demonstrate truncation of the four fractional attributes.
  • npm test: 96 tests passed, plus ESLint, TypeScript and Biome checks. Biome reports two existing configuration notices.
  • npm run build and git diff --check pass.

Prepared and validated with OpenAI Codex assistance.

Summary by CodeRabbit

  • Bug Fixes
    • RSS and Atom media metadata now preserves fractional and zero values for bitrate, frame rate, sampling rate, and duration. Other numeric media attributes continue to be parsed as integers, and missing values remain unset.