diff options
Diffstat (limited to 'src/channels.rs')
| -rw-r--r-- | src/channels.rs | 6 |
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) |
