feat(tv): search indexers by series tvdb id

This commit is contained in:
Miguel Palhas
2026-08-23 16:32:28 +01:00
parent 46de061e68
commit a5706cf1b4
5 changed files with 151 additions and 18 deletions
+5 -3
View File
@@ -370,9 +370,7 @@ impl TvGrabAction {
blacklist: &Blacklist,
) -> Result<Vec<TvCandidate>, GrabError> {
let target = TvTarget {
// The series table carries no TVDB id yet; `tv_request` falls
// back to a text search built from the title and the tag.
tvdb_id: None,
tvdb_id: season.series_tvdb_id.and_then(|id| u64::try_from(id).ok()),
title: season.series_title.clone(),
selector,
};
@@ -472,6 +470,8 @@ struct PendingSeason {
season_id: i64,
season_number: i64,
series_title: String,
/// §6.1: `t=tvsearch` is addressed by this when present.
series_tvdb_id: Option<i64>,
original_language: Option<String>,
}
@@ -509,6 +509,7 @@ async fn pending_seasons(database: &Db) -> Result<Vec<PendingSeason>, GrabError>
SELECT se.id AS "season_id!: i64",
se.number AS "season_number!: i64",
s.title AS "series_title!: String",
s.tvdb_id AS series_tvdb_id,
s.original_language
FROM seasons se
JOIN series s ON s.id = se.series_id
@@ -544,6 +545,7 @@ async fn pending_seasons(database: &Db) -> Result<Vec<PendingSeason>, GrabError>
season_id: row.season_id,
season_number: row.season_number,
series_title: row.series_title,
series_tvdb_id: row.series_tvdb_id,
original_language: row.original_language,
})
.collect())