summaryrefslogtreecommitdiff
path: root/src/channels.rs
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2024-05-31 15:50:42 +0200
committerYuval Adam <_@yuv.al>2024-05-31 15:50:42 +0200
commit2354a93e358961aaf3e0aaf826620dbb30c33ede (patch)
treeb788b749ecb9ef9ef81d49012dc653d2b40c6939 /src/channels.rs
parentf210f63d25dff0fef56b058a027720e81ea7b163 (diff)
Extract get_playlist()
Diffstat (limited to 'src/channels.rs')
-rw-r--r--src/channels.rs6
1 files changed, 6 insertions, 0 deletions
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)