Files
pocket-chords/crates/application/src/songs/update_meta.rs

23 lines
556 B
Rust

use domain::errors::DomainError;
use domain::models::SongSummary;
use super::commands::UpdateSongMetaCommand;
use super::deps::SongCommandDeps;
pub async fn execute(
deps: &SongCommandDeps,
cmd: UpdateSongMetaCommand,
) -> Result<SongSummary, DomainError> {
let result = deps
.repo
.update_meta(
cmd.id,
cmd.title.as_deref(),
cmd.artist.as_deref(),
cmd.original_key.as_deref(),
)
.await?;
tracing::debug!(id = %cmd.id, "song meta updated");
Ok(result)
}