moosync_edk::api

Trait Provider

Source
pub trait Provider {
Show 14 methods // Required method fn get_provider_scopes(&self) -> MoosyncResult<Vec<ExtensionProviderScope>>; // Provided methods fn get_playlists(&self) -> MoosyncResult<Vec<QueryablePlaylist>> { ... } fn get_playlist_content( &self, id: String, next_page_token: Option<String>, ) -> MoosyncResult<Vec<Song>> { ... } fn get_playlist_from_url( &self, url: String, ) -> MoosyncResult<Option<QueryablePlaylist>> { ... } fn get_playback_details( &self, song: Song, ) -> MoosyncResult<PlaybackDetailsReturnType> { ... } fn search(&self, term: String) -> MoosyncResult<SearchResult> { ... } fn get_recommendations(&self) -> MoosyncResult<Vec<Song>> { ... } fn get_song_from_url(&self, url: String) -> MoosyncResult<Option<Song>> { ... } fn handle_custom_request( &self, url: String, ) -> MoosyncResult<CustomRequestReturnType> { ... } fn get_artist_songs( &self, artist: QueryableArtist, next_page_token: Option<String>, ) -> MoosyncResult<Vec<Song>> { ... } fn get_album_songs( &self, album: QueryableAlbum, next_page_token: Option<String>, ) -> MoosyncResult<Vec<Song>> { ... } fn get_song_from_id(&self, id: String) -> MoosyncResult<Option<Song>> { ... } fn scrobble(&self, song: Song) -> MoosyncResult<()> { ... } fn get_lyrics(&self, song: Song) -> MoosyncResult<String> { ... }
}
Expand description

Trait for handling provider-related events.

Required Methods§

Source

fn get_provider_scopes(&self) -> MoosyncResult<Vec<ExtensionProviderScope>>

Called when the main app requests the provider scopes.

Provided Methods§

Source

fn get_playlists(&self) -> MoosyncResult<Vec<QueryablePlaylist>>

Called when the main app requests the list of playlists.

Source

fn get_playlist_content( &self, id: String, next_page_token: Option<String>, ) -> MoosyncResult<Vec<Song>>

Called when the main app requests the content of a specific playlist.

Source

fn get_playlist_from_url( &self, url: String, ) -> MoosyncResult<Option<QueryablePlaylist>>

Called when the main app requests a playlist from a URL.

Source

fn get_playback_details( &self, song: Song, ) -> MoosyncResult<PlaybackDetailsReturnType>

Called when the main app requests playback details for a song.

Source

fn search(&self, term: String) -> MoosyncResult<SearchResult>

Called when the main app performs a search.

Source

fn get_recommendations(&self) -> MoosyncResult<Vec<Song>>

Called when the main app requests recommendations.

Source

fn get_song_from_url(&self, url: String) -> MoosyncResult<Option<Song>>

Called when the main app requests a song from a URL.

Source

fn handle_custom_request( &self, url: String, ) -> MoosyncResult<CustomRequestReturnType>

Called when the main app handles a custom request.

Source

fn get_artist_songs( &self, artist: QueryableArtist, next_page_token: Option<String>, ) -> MoosyncResult<Vec<Song>>

Called when the main app requests songs of a specific artist.

Source

fn get_album_songs( &self, album: QueryableAlbum, next_page_token: Option<String>, ) -> MoosyncResult<Vec<Song>>

Called when the main app requests songs of a specific album.

Source

fn get_song_from_id(&self, id: String) -> MoosyncResult<Option<Song>>

Called when the main app requests a song from an ID.

Source

fn scrobble(&self, song: Song) -> MoosyncResult<()>

Called when the main app requests to scrobble a song.

Source

fn get_lyrics(&self, song: Song) -> MoosyncResult<String>

Called when the main app requests lyrics for a song.

Implementors§