From 11d2fa9ad6aa208436480368d8431a91a1568e74 Mon Sep 17 00:00:00 2001 From: dev Date: Sun, 14 Jun 2026 17:30:06 +0200 Subject: [PATCH] feat(ui): show sample rate in the audio quality string (FLAC 24bit/96kHz) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit get_audio_quality_string now appends the FLAC sample rate so the Downloads quality chip and library history read e.g. 'FLAC 24bit/96kHz' instead of just 'FLAC 24bit' — surfaces hi-res frequency (44.1/48/96/192kHz) at a glance. Co-Authored-By: Claude Opus 4.8 --- core/imports/file_ops.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/imports/file_ops.py b/core/imports/file_ops.py index 7539d4a4..d6c78d48 100644 --- a/core/imports/file_ops.py +++ b/core/imports/file_ops.py @@ -192,6 +192,9 @@ def get_audio_quality_string(file_path): if ext == ".flac": from mutagen.flac import FLAC audio = FLAC(file_path) + sr = getattr(audio.info, "sample_rate", 0) or 0 + if sr: + return f"FLAC {audio.info.bits_per_sample}bit/{sr / 1000:g}kHz" return f"FLAC {audio.info.bits_per_sample}bit" if ext == ".mp3":