Skip to content

Commit

Permalink
chore: rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
QPixel committed Jan 5, 2024
1 parent 917699a commit 5dcbd3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/api/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,9 @@ impl SpotifyClient {
pub(crate) fn get_playlist(&self, id: &str) -> SpotifyRequest<'_, (), Playlist> {
let query = make_query_params()
.append_pair("market", "from_token")
// why still grab the tracks field?
// why still grab the tracks field?
// the model still expects the appearance of a tracks field
.append_pair(
"fields",
"id,name,images,owner,tracks(total)",
)
.append_pair("fields", "id,name,images,owner,tracks(total)")
.finish();
self.request()
.method(Method::GET)
Expand Down
11 changes: 6 additions & 5 deletions src/app/components/playlist_details/playlist_details_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ impl PlaylistDetailsModel {
if playlist.songs.songs.is_empty() {
error!("Unable to start playback because songs is empty");
self.dispatcher
.dispatch(
AppAction::ShowNotification(gettext(
.dispatch(AppAction::ShowNotification(gettext(
"An error occured. Check logs for details!",
)));
return;
Expand Down Expand Up @@ -97,9 +96,11 @@ impl PlaylistDetailsModel {
let playlist = api.get_playlist(&id).await;
let playlist_tracks = api.get_playlist_tracks(&id, 0, 100).await?;
match playlist {
Ok(playlist) => {
Ok(BrowserAction::SetPlaylistDetails(Box::new(playlist), Box::new(playlist_tracks)).into())
}
Ok(playlist) => Ok(BrowserAction::SetPlaylistDetails(
Box::new(playlist),
Box::new(playlist_tracks),
)
.into()),
Err(SpotifyApiError::BadStatus(400, _))
| Err(SpotifyApiError::BadStatus(404, _)) => {
Ok(BrowserAction::NavigationPop.into())
Expand Down

0 comments on commit 5dcbd3d

Please sign in to comment.