pub struct SubsonicClient { /* private fields */ }Expand description
Subsonic/Navidrome API client.
Implementations§
Source§impl SubsonicClient
impl SubsonicClient
pub fn new(base_url: &str, username: &str, password: &str) -> Self
Sourcepub fn ping(&self) -> Result<(), SubsonicError>
pub fn ping(&self) -> Result<(), SubsonicError>
Ping the server — verify connection and credentials.
Sourcepub fn get_artists(&self) -> Result<Vec<SubsonicArtist>, SubsonicError>
pub fn get_artists(&self) -> Result<Vec<SubsonicArtist>, SubsonicError>
Get all artists (indexed).
Sourcepub fn get_album(&self, id: &str) -> Result<SubsonicAlbumFull, SubsonicError>
pub fn get_album(&self, id: &str) -> Result<SubsonicAlbumFull, SubsonicError>
Get an album by ID, including its tracks.
Sourcepub fn get_album_list(
&self,
list_type: &str,
size: u32,
offset: u32,
) -> Result<Vec<SubsonicAlbum>, SubsonicError>
pub fn get_album_list( &self, list_type: &str, size: u32, offset: u32, ) -> Result<Vec<SubsonicAlbum>, SubsonicError>
Get a paginated list of albums.
Sourcepub fn stream_url(&self, track_id: &str) -> String
pub fn stream_url(&self, track_id: &str) -> String
Build the streaming URL for a track (doesn’t make a request).
Sourcepub fn stream_url_template(&self, track_id: &str) -> String
pub fn stream_url_template(&self, track_id: &str) -> String
Stream URL without auth params — safe for database storage.
Sourcepub fn download(&self, track_id: &str, dest: &Path) -> Result<(), SubsonicError>
pub fn download(&self, track_id: &str, dest: &Path) -> Result<(), SubsonicError>
Download a track to a local path.
Sourcepub fn download_with_progress(
&self,
track_id: &str,
dest: &Path,
on_progress: impl Fn(u64, u64),
) -> Result<(), SubsonicError>
pub fn download_with_progress( &self, track_id: &str, dest: &Path, on_progress: impl Fn(u64, u64), ) -> Result<(), SubsonicError>
Download a track with progress reporting. The callback receives (bytes_downloaded, total_bytes). Total may be 0 if the server doesn’t send Content-Length.
Sourcepub fn search(&self, query: &str) -> Result<SubsonicSearchResult, SubsonicError>
pub fn search(&self, query: &str) -> Result<SubsonicSearchResult, SubsonicError>
Search for tracks/albums/artists.
Sourcepub fn star(&self, track_id: &str) -> Result<(), SubsonicError>
pub fn star(&self, track_id: &str) -> Result<(), SubsonicError>
Star (favourite) a track on the server.
Sourcepub fn unstar(&self, track_id: &str) -> Result<(), SubsonicError>
pub fn unstar(&self, track_id: &str) -> Result<(), SubsonicError>
Unstar (unfavourite) a track on the server.
Sourcepub fn get_starred(&self) -> Result<Vec<SubsonicSong>, SubsonicError>
pub fn get_starred(&self) -> Result<Vec<SubsonicSong>, SubsonicError>
Get all starred (favourite) songs from the server.
Create a sharing link for one or more resources (songs, albums, etc). Returns the created share including its ID which forms the public URL.
Sourcepub fn get_similar_songs(
&self,
song_id: &str,
count: usize,
) -> Result<Vec<SubsonicSong>, SubsonicError>
pub fn get_similar_songs( &self, song_id: &str, count: usize, ) -> Result<Vec<SubsonicSong>, SubsonicError>
Get similar songs for a track (Subsonic getSimilarSongs2 endpoint).
Returns up to count similar songs based on the server’s algorithm.
Sourcepub fn get_top_songs(
&self,
artist_name: &str,
count: usize,
) -> Result<Vec<SubsonicSong>, SubsonicError>
pub fn get_top_songs( &self, artist_name: &str, count: usize, ) -> Result<Vec<SubsonicSong>, SubsonicError>
Get top songs for an artist by name.
Auto Trait Implementations§
impl Freeze for SubsonicClient
impl !RefUnwindSafe for SubsonicClient
impl Send for SubsonicClient
impl Sync for SubsonicClient
impl Unpin for SubsonicClient
impl UnsafeUnpin for SubsonicClient
impl !UnwindSafe for SubsonicClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more