Formatting

This commit is contained in:
Connor Johnstone
2026-03-18 15:37:21 -04:00
parent d09557d953
commit d358b79a6b
3 changed files with 59 additions and 29 deletions

View File

@@ -1,5 +1,5 @@
use shanty_tag::provider::MetadataProvider;
use shanty_tag::MusicBrainzClient;
use shanty_tag::provider::MetadataProvider;
use crate::error::SearchResult;
use crate::provider::{
@@ -20,11 +20,7 @@ impl MusicBrainzSearch {
}
impl SearchProvider for MusicBrainzSearch {
async fn search_artist(
&self,
query: &str,
limit: u32,
) -> SearchResult<Vec<ArtistResult>> {
async fn search_artist(&self, query: &str, limit: u32) -> SearchResult<Vec<ArtistResult>> {
let results = self.client.search_artist(query, limit).await?;
Ok(results
.into_iter()
@@ -55,7 +51,11 @@ impl SearchProvider for MusicBrainzSearch {
title: r.title,
artist: r.artist,
artist_id: r.artist_mbid,
year: r.date.as_deref().and_then(|d| d.split('-').next()).map(String::from),
year: r
.date
.as_deref()
.and_then(|d| d.split('-').next())
.map(String::from),
track_count: r.track_count,
score: r.score,
})
@@ -85,10 +85,7 @@ impl SearchProvider for MusicBrainzSearch {
.collect())
}
async fn get_discography(
&self,
artist_id: &str,
) -> SearchResult<Discography> {
async fn get_discography(&self, artist_id: &str) -> SearchResult<Discography> {
let releases = self.client.get_artist_releases(artist_id, 100).await?;
// Try to get the artist name from the first release, or use the MBID