From 2354a93e358961aaf3e0aaf826620dbb30c33ede Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Fri, 31 May 2024 15:50:42 +0200 Subject: Extract get_playlist() --- src/channels.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/channels.rs') diff --git a/src/channels.rs b/src/channels.rs index 1c7ed3c..09d7fc0 100644 --- a/src/channels.rs +++ b/src/channels.rs @@ -9,6 +9,12 @@ pub struct Channel { pub image: String, } +impl Channel { + pub fn get_playlist(&self) -> String { + format!("https://api.somafm.com/{}.pls", self.id) + } +} + impl fmt::Display for Channel { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}: {}", self.title, self.description) -- cgit v1.3.1