mirror of
https://github.com/yattee/yattee.git
synced 2026-08-26 00:42:33 +00:00
MPVTrack.detailText built its sample-rate label with integer division (`sampleRate / 1000`), which truncates the fractional kHz. The second-most-common audio rate — 44100 Hz (CD quality, music videos) — showed as "44 kHz", a label that denotes 44000 Hz (a different rate), instead of the conventional "44.1 kHz" used by VLC, mpv and every DAW. The same defect hit 88200 -> "88 kHz", 176400 -> "176 kHz" and 22050 -> "22 kHz". Whole-kHz rates (48000, 96000, ...) were already correct and stay unchanged. The label is live in the quality selector's advanced details, where EmbeddedTrackRowView renders track.detailText. - Factor the formatting into MPVTrack.formatSampleRate(_:), a pure static helper: divide as Double, drop the decimal for whole kHz, otherwise keep 1-2 meaningful digits with the trailing zero stripped (44.1, 88.2, 22.05). - detailText now appends Self.formatSampleRate(sampleRate); its structure (codec / channelCount parts, separator, nil-when-empty) is unchanged. - Add YatteeTests/MPVTrackFormatTests covering whole-kHz rates, the 44.1 kHz family (the bug), half-decimal rates and the detailText integration.