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

@@ -199,6 +199,12 @@ impl ListItem for Album {
Some(AlbumView::new(queue, library, self).as_boxed_view_ext())
}
fn share_url(&self) -> Option<String> {
self.id
.clone()
.map(|id| format!("https://open.spotify.com/album/{}", id))
}
fn artist(&self) -> Option<Artist> {
Some(Artist::new(
self.artist_ids[0].clone(),