Formatting
This commit is contained in:
@@ -107,12 +107,16 @@ pub async fn tag_track(
|
||||
|
||||
// Upsert primary artist with MusicBrainz ID
|
||||
let artist_id = match &details.artist_mbid {
|
||||
Some(mbid) => {
|
||||
Some(queries::artists::upsert(conn, &details.artist, Some(mbid)).await?.id)
|
||||
}
|
||||
None => {
|
||||
Some(queries::artists::upsert(conn, &details.artist, None).await?.id)
|
||||
}
|
||||
Some(mbid) => Some(
|
||||
queries::artists::upsert(conn, &details.artist, Some(mbid))
|
||||
.await?
|
||||
.id,
|
||||
),
|
||||
None => Some(
|
||||
queries::artists::upsert(conn, &details.artist, None)
|
||||
.await?
|
||||
.id,
|
||||
),
|
||||
};
|
||||
|
||||
// Upsert secondary collaborator artists so they exist as separate library entries
|
||||
@@ -174,16 +178,16 @@ pub async fn tag_track(
|
||||
queries::tracks::update_metadata(conn, track.id, active).await?;
|
||||
|
||||
// Optionally write tags to file
|
||||
if config.write_tags {
|
||||
if let Err(e) = file_tags::write_tags(
|
||||
if config.write_tags
|
||||
&& let Err(e) = file_tags::write_tags(
|
||||
&track.file_path,
|
||||
&details,
|
||||
best_release.as_ref(),
|
||||
year,
|
||||
genre.as_deref(),
|
||||
) {
|
||||
tracing::warn!(id = track.id, path = %track.file_path, "failed to write file tags: {e}");
|
||||
}
|
||||
)
|
||||
{
|
||||
tracing::warn!(id = track.id, path = %track.file_path, "failed to write file tags: {e}");
|
||||
}
|
||||
|
||||
Ok(true)
|
||||
|
||||
Reference in New Issue
Block a user