feat(meta): substitute TBA for unnamed episodes

This commit is contained in:
Miguel Palhas
2026-08-23 20:55:16 +01:00
parent 4762f2612f
commit 23f5781714
4 changed files with 88 additions and 2 deletions
+1
View File
@@ -25,4 +25,5 @@ pub use client::{TmdbClient, TmdbClientBuilder, DEFAULT_BASE_URL, DEFAULT_CACHE_
pub use error::{Error, Result};
pub use model::{
Episode, ExternalIds, FindResults, Movie, MovieSearchResult, Season, Series, SeriesSearchResult,
UNTITLED_EPISODE,
};
+11 -1
View File
@@ -140,6 +140,10 @@ pub struct SeasonSummary {
pub episode_count: u32,
}
/// Placeholder for an episode TMDB has not named yet. #121's refresh replaces
/// it once TMDB fills the title in.
pub const UNTITLED_EPISODE: &str = "TBA";
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Season {
pub number: u32,
@@ -285,7 +289,13 @@ impl From<RawSeason> for Season {
.into_iter()
.map(|episode| Episode {
number: episode.episode_number,
title: episode.name,
// TMDB leaves an unaired episode's name empty; a placeholder
// keeps "" out of search, filenames and the compat shim.
title: if episode.name.is_empty() {
UNTITLED_EPISODE.to_owned()
} else {
episode.name
},
air_date: episode.air_date.as_deref().and_then(parse_date),
})
.collect(),