making it AP complaint
Some checks failed
CI / Check / Test (push) Has been cancelled

This commit is contained in:
2026-06-30 02:25:42 +02:00
parent 943a0abe54
commit 5ae38c834a
66 changed files with 3635 additions and 2369 deletions

View File

@@ -3,8 +3,8 @@ use std::sync::Arc;
use anyhow::Context;
use domain::ports::{
ImageRefCommand, ImageRefQuery, ImportSessionRepository, LocalApContentQuery,
MovieProfileRepository, MovieRepository, PersonCommand, PersonQuery, SearchCommand,
UserRepository, WatchEventRepository,
MovieDeduplicator, MovieProfileRepository, MovieRepository, PersonCommand, PersonQuery,
SearchCommand, UserRepository, WatchEventRepository,
};
pub enum DbPool {
@@ -31,6 +31,7 @@ pub struct WorkerDbOutput {
pub remote_goal: Arc<dyn domain::ports::RemoteGoalRepository>,
pub refresh_session: Arc<dyn domain::ports::RefreshSessionRepository>,
pub federation_settings: Arc<dyn domain::ports::UserFederationSettingsQuery>,
pub deduplicator: Arc<dyn MovieDeduplicator>,
pub db_pool: DbPool,
}
@@ -66,6 +67,7 @@ pub async fn connect(database_url: &str, backend: &str) -> anyhow::Result<Worker
w.pool.clone(),
)) as _,
federation_settings: w.federation_settings,
deduplicator: w.deduplicator,
db_pool: DbPool::Postgres(w.pool),
})
}
@@ -98,6 +100,7 @@ pub async fn connect(database_url: &str, backend: &str) -> anyhow::Result<Worker
refresh_session: Arc::new(sqlite::SqliteRefreshSessionAdapter::new(w.pool.clone()))
as _,
federation_settings: w.federation_settings,
deduplicator: w.deduplicator,
db_pool: DbPool::Sqlite(w.pool),
})
}

View File

@@ -62,6 +62,7 @@ async fn main() -> anyhow::Result<()> {
};
let movie = db.movie;
let deduplicator = db.deduplicator;
let user = db.user;
let import_session = db.import_session;
let movie_profile = db.movie_profile;
@@ -130,6 +131,11 @@ async fn main() -> anyhow::Result<()> {
// ── Periodic jobs ─────────────────────────────────────────────────────────
let mut periodic_jobs: Vec<Arc<dyn PeriodicJob>> = vec![
Arc::new(application::jobs::MovieDeduplicationJob::new(
Arc::clone(&movie),
Arc::clone(&deduplicator),
Arc::clone(&object_storage),
)),
Arc::new(application::jobs::ImportSessionCleanupJob::new(
import_session.clone(),
)),