pyradio: add per-station buffering option
This commit is contained in:
parent
e04cf4c16d
commit
358bafaf95
3 changed files with 23 additions and 2 deletions
|
|
@ -61,6 +61,24 @@ in
|
|||
description = "Stream URL of the radio station.";
|
||||
};
|
||||
|
||||
buffering = mkOption {
|
||||
type = nullOr (submodule {
|
||||
options = {
|
||||
seconds = mkOption {
|
||||
type = ints.positive;
|
||||
description = "Number of seconds to buffer the stream.";
|
||||
};
|
||||
bitrate = mkOption {
|
||||
type = ints.positive;
|
||||
default = 128;
|
||||
description = "Bitrate of the stream in kbps (modify only if using MPlayer).";
|
||||
};
|
||||
};
|
||||
});
|
||||
description = "Buffering configuration to apply to the station.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
encoding = mkOption {
|
||||
type = str;
|
||||
default = "";
|
||||
|
|
@ -142,7 +160,9 @@ in
|
|||
station.encoding
|
||||
(escapeCSV station.iconUrl)
|
||||
""
|
||||
""
|
||||
(lib.optionalString (
|
||||
station.buffering != null
|
||||
) "${toString station.buffering.seconds}@${toString station.buffering.bitrate}")
|
||||
(if station.forceHttp then "1" else "0")
|
||||
(toString station.volume)
|
||||
]
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
{
|
||||
name = "DEF CON Radio (SomaFM)";
|
||||
url = "https://somafm.com/defcon256.pls";
|
||||
buffering.seconds = 10;
|
||||
volume = 85;
|
||||
encoding = "utf-8";
|
||||
iconUrl = "https://somafm.com/img3/defcon400.png";
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@ DEF CON Radio (SomaFM),https://somafm.com/defcon256.pls,,,,,0,50
|
|||
"DEF CON Radio, SomaFM",https://somafm.com/defcon256.pls,,,,,0,50
|
||||
"DEF CON Radio on ""SomaFM""",https://somafm.com/defcon256.pls,,,,,0,50
|
||||
"DEF CON Radio on ""SomaFM""",https://somafm.com/defcon256.pls,,,,,0,50
|
||||
DEF CON Radio (SomaFM),https://somafm.com/defcon256.pls,utf-8,https://somafm.com/img3/defcon400.png,,,1,85
|
||||
DEF CON Radio (SomaFM),https://somafm.com/defcon256.pls,utf-8,https://somafm.com/img3/defcon400.png,,10@128,1,85
|
||||
|
|
|
|||
|
Loading…
Add table
Add a link
Reference in a new issue