State full 'Episode' text if there's no episode name

This commit is contained in:
rlaphoenix 2023-03-02 16:19:46 +00:00
parent f8a8309628
commit 3456e24846
1 changed files with 6 additions and 4 deletions

View File

@ -196,11 +196,13 @@ class Series(SortedKeyList, ABC):
)
for episode in self:
if episode.season == season:
season_tree.add(
f"[bold]{str(episode.number).zfill(len(str(episodes)))}" + (
f".[/] [bright_black]{episode.name}" if episode.name else ""
if episode.name:
season_tree.add(
f"[bold]{str(episode.number).zfill(len(str(episodes)))}.[/] "
f"[bright_black]{episode.name}"
)
)
else:
season_tree.add(f"[bright_black]Episode {str(episode.number).zfill(len(str(episodes)))}")
return tree