Move URL handling to relevant structs and share selected song

This commit is contained in:
Rasmus Larsen
2019-05-09 16:04:07 +02:00
parent a145d73072
commit 4897d97931
7 changed files with 58 additions and 10 deletions

View File

@@ -193,4 +193,10 @@ impl ListItem for Artist {
fn open(&self, queue: Arc<Queue>, library: Arc<Library>) -> Option<Box<dyn ViewExt>> {
Some(ArtistView::new(queue, library, self).as_boxed_view_ext())
}
fn share_url(&self) -> Option<String> {
self.id
.clone()
.map(|id| format!("https://open.spotify.com/artist/{}", id))
}
}