Fix spelling mistake
This commit is contained in:
committed by
Henrik Friedrichsen
parent
6e2b108284
commit
3d11b2c333
@@ -683,7 +683,7 @@ impl Spotify {
|
|||||||
self.api_with_retry(|api| api.get_an_episode(episode_id.to_string(), self.country))
|
self.api_with_retry(|api| api.get_an_episode(episode_id.to_string(), self.country))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn recommentations(
|
pub fn recommendations(
|
||||||
&self,
|
&self,
|
||||||
seed_artists: Option<Vec<String>>,
|
seed_artists: Option<Vec<String>>,
|
||||||
seed_genres: Option<Vec<String>>,
|
seed_genres: Option<Vec<String>>,
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ impl ListItem for Track {
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
fn open_recommentations(
|
fn open_recommendations(
|
||||||
&self,
|
&self,
|
||||||
queue: Arc<Queue>,
|
queue: Arc<Queue>,
|
||||||
library: Arc<Library>,
|
library: Arc<Library>,
|
||||||
@@ -250,7 +250,7 @@ impl ListItem for Track {
|
|||||||
|
|
||||||
let recommendations: Option<Vec<Track>> = if let Some(id) = &self.id {
|
let recommendations: Option<Vec<Track>> = if let Some(id) = &self.id {
|
||||||
spotify
|
spotify
|
||||||
.recommentations(None, None, Some(vec![id.clone()]))
|
.recommendations(None, None, Some(vec![id.clone()]))
|
||||||
.map(|r| r.tracks)
|
.map(|r| r.tracks)
|
||||||
.map(|tracks| tracks.iter().map(Track::from).collect())
|
.map(|tracks| tracks.iter().map(Track::from).collect())
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ pub trait ListItem: Sync + Send + 'static {
|
|||||||
fn save(&mut self, library: Arc<Library>);
|
fn save(&mut self, library: Arc<Library>);
|
||||||
fn unsave(&mut self, library: Arc<Library>);
|
fn unsave(&mut self, library: Arc<Library>);
|
||||||
fn open(&self, queue: Arc<Queue>, library: Arc<Library>) -> Option<Box<dyn ViewExt>>;
|
fn open(&self, queue: Arc<Queue>, library: Arc<Library>) -> Option<Box<dyn ViewExt>>;
|
||||||
fn open_recommentations(
|
fn open_recommendations(
|
||||||
&self,
|
&self,
|
||||||
_queue: Arc<Queue>,
|
_queue: Arc<Queue>,
|
||||||
_library: Arc<Library>,
|
_library: Arc<Library>,
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ enum ContextMenuAction {
|
|||||||
SelectArtist(Vec<Artist>),
|
SelectArtist(Vec<Artist>),
|
||||||
ShareUrl(String),
|
ShareUrl(String),
|
||||||
AddToPlaylist(Box<Track>),
|
AddToPlaylist(Box<Track>),
|
||||||
ShowRecommentations(Box<dyn ListItem>),
|
ShowRecommendations(Box<dyn ListItem>),
|
||||||
ToggleTrackSavedStatus(Box<Track>),
|
ToggleTrackSavedStatus(Box<Track>),
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ impl ContextMenu {
|
|||||||
);
|
);
|
||||||
content.add_item(
|
content.add_item(
|
||||||
"Similar tracks",
|
"Similar tracks",
|
||||||
ContextMenuAction::ShowRecommentations(Box::new(t.clone())),
|
ContextMenuAction::ShowRecommendations(Box::new(t.clone())),
|
||||||
);
|
);
|
||||||
content.add_item(
|
content.add_item(
|
||||||
match library.is_saved_track(&Playable::Track(t.clone())) {
|
match library.is_saved_track(&Playable::Track(t.clone())) {
|
||||||
@@ -195,8 +195,8 @@ impl ContextMenu {
|
|||||||
Self::add_track_dialog(library, queue.get_spotify(), *track.clone());
|
Self::add_track_dialog(library, queue.get_spotify(), *track.clone());
|
||||||
s.add_layer(dialog);
|
s.add_layer(dialog);
|
||||||
}
|
}
|
||||||
ContextMenuAction::ShowRecommentations(item) => {
|
ContextMenuAction::ShowRecommendations(item) => {
|
||||||
if let Some(view) = item.open_recommentations(queue, library) {
|
if let Some(view) = item.open_recommendations(queue, library) {
|
||||||
s.call_on_name("main", move |v: &mut Layout| v.push_view(view));
|
s.call_on_name("main", move |v: &mut Layout| v.push_view(view));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user