style(arr): formatting
This commit is contained in:
@@ -58,7 +58,11 @@ impl SubtitleUpstreams {
|
||||
|
||||
let mut lamps = Vec::new();
|
||||
for id in &providers_enabled {
|
||||
let reachable = match self.providers.iter().find(|p| p.id().as_str() == id.as_str()) {
|
||||
let reachable = match self
|
||||
.providers
|
||||
.iter()
|
||||
.find(|p| p.id().as_str() == id.as_str())
|
||||
{
|
||||
Some(provider) => provider.probe().await.is_ok(),
|
||||
None => false,
|
||||
};
|
||||
@@ -246,7 +250,9 @@ mod tests {
|
||||
/// lamps the seed row would otherwise put in use.
|
||||
async fn database() -> (tempfile::TempDir, Db) {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let db = Db::connect(dir.path().join("broken-test.db")).await.unwrap();
|
||||
let db = Db::connect(dir.path().join("broken-test.db"))
|
||||
.await
|
||||
.unwrap();
|
||||
db.migrate().await.unwrap();
|
||||
sqlx::query("UPDATE subtitle_settings SET providers_enabled = '[]'")
|
||||
.execute(db.pool())
|
||||
@@ -320,7 +326,9 @@ mod tests {
|
||||
.await;
|
||||
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let db = Db::connect(dir.path().join("broken-subs.db")).await.unwrap();
|
||||
let db = Db::connect(dir.path().join("broken-subs.db"))
|
||||
.await
|
||||
.unwrap();
|
||||
db.migrate().await.unwrap();
|
||||
// The seed row already enables opensubtitles and podnapisi; none are
|
||||
// attached to this action.
|
||||
@@ -394,7 +402,9 @@ mod tests {
|
||||
let first = action.tick(&db).await;
|
||||
assert_eq!(first.len(), 1, "only the missing binary notifies");
|
||||
assert!(
|
||||
first.iter().any(|outcome| format!("{outcome:?}").contains("alass")),
|
||||
first
|
||||
.iter()
|
||||
.any(|outcome| format!("{outcome:?}").contains("alass")),
|
||||
"{first:?}"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -303,7 +303,8 @@ fn reconcile_loop(
|
||||
tmdb: Option<&Arc<TmdbClient>>,
|
||||
notifier: &Notifier,
|
||||
translators: &Translators,
|
||||
) -> Result<(ReconcileLoop, Option<GrabAction>, Option<TvGrabAction>), Error> { let reconcile = ReconcileLoop::new(database.clone());
|
||||
) -> Result<(ReconcileLoop, Option<GrabAction>, Option<TvGrabAction>), Error> {
|
||||
let reconcile = ReconcileLoop::new(database.clone());
|
||||
let seeding = SeedingRules::new(
|
||||
SeedingLimits {
|
||||
ratio: config.seed_ratio_limit,
|
||||
@@ -435,7 +436,12 @@ fn register_broken(
|
||||
};
|
||||
reconcile.register(
|
||||
Tick::Reconcile,
|
||||
BrokenAction::new(broken_upstreams, broken_subtitles, notifier.clone(), operator_topic),
|
||||
BrokenAction::new(
|
||||
broken_upstreams,
|
||||
broken_subtitles,
|
||||
notifier.clone(),
|
||||
operator_topic,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user