refactor(movies): EnrichMovieDeps, ReindexSearchDeps, SyncPosterDeps, SearchReindexHandler, EnrichmentStalenessJob

This commit is contained in:
2026-06-11 22:13:25 +02:00
parent 66bd138927
commit 1e62f12903
15 changed files with 224 additions and 125 deletions

View File

@@ -1,6 +1,11 @@
use std::sync::Arc;
use application::movies::{commands::EnrichMovieCommand, enrich_movie, request_enrichment};
use application::movies::{
commands::EnrichMovieCommand,
deps::EnrichMovieDeps,
enrich_movie,
request_enrichment,
};
use async_trait::async_trait;
use domain::{
errors::DomainError,
@@ -89,13 +94,12 @@ impl EventHandler for MovieEnrichmentHandler {
};
self.download_cast_photos(&profile).await;
enrich_movie::execute(
&self.movie_repository,
&self.profile_repo,
&self.person_command,
&self.search_command,
EnrichMovieCommand { movie_id, profile },
)
.await
let enrich_deps = EnrichMovieDeps {
movie: self.movie_repository.clone(),
movie_profile: self.profile_repo.clone(),
person_command: self.person_command.clone(),
search_command: self.search_command.clone(),
};
enrich_movie::execute(&enrich_deps, EnrichMovieCommand { movie_id, profile }).await
}
}