feat(api): expose vanished flag on episodes

This commit is contained in:
Miguel Palhas
2026-08-23 17:59:45 +01:00
parent 8b9a6d5a16
commit 34ccbeeb5a
6 changed files with 55 additions and 24 deletions
+4 -4
View File
@@ -22,7 +22,7 @@
//!
//! Refresh is idempotent: over unchanged TMDB data only the stamp moves.
use std::collections::HashMap;
use std::collections::{HashMap, HashSet};
use std::sync::Arc;
use arr_core::tracking::{apply_auto_track, apply_tracked, RefreshedSeason};
@@ -354,14 +354,14 @@ impl SeriesRefreshAction {
known: &HashMap<i64, (i64, String, Option<String>, bool)>,
detail: &TmdbSeasonDetail,
) -> Result<bool, RefreshError> {
let upstream: HashMap<i64, ()> = detail
let upstream: HashSet<i64> = detail
.episodes
.iter()
.map(|source| (i64::from(source.number), ()))
.map(|source| i64::from(source.number))
.collect();
let mut changed = false;
for (number, &(id, ..)) in known {
if upstream.contains_key(number) {
if upstream.contains(number) {
continue;
}
let has_file = sqlx::query_scalar!(