From ba05a3cb0c4b70f8dbb0dd2f91a056041de8fd22 Mon Sep 17 00:00:00 2001 From: Breadway Date: Tue, 21 Jul 2026 20:22:27 +0800 Subject: [PATCH] Default TVDB "season 0" specials to unmonitored Season 0 is TVDB's catch-all for specials/recaps/shorts and often a tie-in movie already tracked as its own separate media_item (verified live: Chainsaw Man's season 0 included a movie already present as its own entry). Monitoring these by default means the library never actually "completes" and inflates the missing-episode count with content nobody asked to acquire as an episode. Regular seasons are unaffected. --- breadarrd/src/metadata/mod.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/breadarrd/src/metadata/mod.rs b/breadarrd/src/metadata/mod.rs index e5c4b25..788a584 100644 --- a/breadarrd/src/metadata/mod.rs +++ b/breadarrd/src/metadata/mod.rs @@ -97,23 +97,34 @@ pub fn insert_series( let mut seasons_seen = HashSet::new(); for ep in episodes { + // TVDB's "season 0" is a catch-all for specials — recaps, shorts, + // and often a tie-in movie that's frequently already tracked as + // its own separate `media_item` (verified live: Chainsaw Man's + // season 0 included "Chainsaw Man – The Movie: Reze Arc", which + // already exists as its own movie entry). Monitoring these by + // default means the library never actually "completes" and the + // missing-episode count is inflated with content the user was + // never trying to acquire as episodes in the first place. Regular + // seasons keep the previous default of monitored. + let monitored = i64::from(ep.season_number != 0); if seasons_seen.insert(ep.season_number) { conn.execute( - "INSERT OR IGNORE INTO season (media_item_id, season_number, monitored) VALUES (?1, ?2, 1)", - params![media_item_id, ep.season_number], + "INSERT OR IGNORE INTO season (media_item_id, season_number, monitored) VALUES (?1, ?2, ?3)", + params![media_item_id, ep.season_number, monitored], )?; } conn.execute( "INSERT OR IGNORE INTO episode (media_item_id, season_number, episode_number, absolute_number, title, air_date, monitored, has_file) - VALUES (?1, ?2, ?3, ?4, ?5, ?6, 1, 0)", + VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, 0)", params![ media_item_id, ep.season_number, ep.episode_number, ep.absolute_number, ep.title, - ep.air_date + ep.air_date, + monitored, ], )?; }