From ebe3ca5c9c01ddb682f5ebff6b0508181f125bf3 Mon Sep 17 00:00:00 2001 From: magicquark <198001825+magicquark@users.noreply.github.com> Date: Thu, 19 Feb 2026 02:54:00 +0000 Subject: [PATCH] pyradio: add per-station encoding option --- modules/programs/pyradio.nix | 8 +++++++- tests/modules/programs/pyradio/custom-stations.nix | 1 + tests/modules/programs/pyradio/expected-stations.csv | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/programs/pyradio.nix b/modules/programs/pyradio.nix index c60d7100..b8ebdb44 100644 --- a/modules/programs/pyradio.nix +++ b/modules/programs/pyradio.nix @@ -61,6 +61,12 @@ in description = "Stream URL of the radio station."; }; + encoding = mkOption { + type = str; + default = ""; + description = "Encoding of the station's metadata block."; + }; + volume = mkOption { type = ints.between 0 130; default = 50; @@ -121,7 +127,7 @@ in lib.concatStringsSep "," [ (escapeCSV station.name) (escapeCSV station.url) - "" + station.encoding "" "" "" diff --git a/tests/modules/programs/pyradio/custom-stations.nix b/tests/modules/programs/pyradio/custom-stations.nix index 372901b1..0a0b4ec8 100644 --- a/tests/modules/programs/pyradio/custom-stations.nix +++ b/tests/modules/programs/pyradio/custom-stations.nix @@ -24,6 +24,7 @@ name = "DEF CON Radio (SomaFM)"; url = "https://somafm.com/defcon256.pls"; volume = 85; + encoding = "utf-8"; } ]; }; diff --git a/tests/modules/programs/pyradio/expected-stations.csv b/tests/modules/programs/pyradio/expected-stations.csv index 1c697996..31f435b7 100644 --- a/tests/modules/programs/pyradio/expected-stations.csv +++ b/tests/modules/programs/pyradio/expected-stations.csv @@ -2,4 +2,4 @@ DEF CON Radio (SomaFM),https://somafm.com/defcon256.pls,,,,,,50 "DEF CON Radio, SomaFM",https://somafm.com/defcon256.pls,,,,,,50 "DEF CON Radio on ""SomaFM""",https://somafm.com/defcon256.pls,,,,,,50 "DEF CON Radio on ""SomaFM""",https://somafm.com/defcon256.pls,,,,,,50 -DEF CON Radio (SomaFM),https://somafm.com/defcon256.pls,,,,,,85 +DEF CON Radio (SomaFM),https://somafm.com/defcon256.pls,utf-8,,,,,85