Skip to content

Commit

Permalink
fix(api): optional field
Browse files Browse the repository at this point in the history
  • Loading branch information
bendikrb committed Oct 24, 2024
1 parent b2e4826 commit 6c6b7b9
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions nrk_psapi/models/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ def __rich_console__(self, console: Console, options: ConsoleOptions) -> RenderR
yield f"[b]{self.type}[/b]"
table = Table("Attribute", "Value")
table.add_row("id", self.id)
table.add_row("title", self.title)
table.add_row("tagline", self.tagline)
table.add_row("podcast.podcast_id", self.podcast.podcast_id)
table.add_row("podcast.podcast_title", self.podcast.podcast_title)
table.add_row("podcast.number_of_episodes", str(self.podcast.number_of_episodes))
yield table

Expand Down Expand Up @@ -486,7 +486,13 @@ def __rich_console__(self, console: Console, options: ConsoleOptions) -> RenderR
yield f"[b]{self.type}[/b]"
table = Table("Attribute", "Value")
table.add_row("id", self.id)
table.add_row("podcast_season", str(self.podcast_season))
table.add_row("podcast_season.podcast_id", self.podcast_season.podcast_id)
table.add_row("podcast_season.season_id", self.podcast_season.season_id)
table.add_row("podcast_season.season_number", str(self.podcast_season.season_number))
table.add_row("podcast_season.number_of_episodes", str(self.podcast_season.number_of_episodes))
table.add_row("podcast_season.image_url", self.podcast_season.image_url)
table.add_row("podcast_season.podcast_title", self.podcast_season.podcast_title)
table.add_row("podcast_season.podcast_season_title", self.podcast_season.podcast_season_title)
yield table


Expand All @@ -507,8 +513,8 @@ def __rich_console__(self, console: Console, options: ConsoleOptions) -> RenderR
@dataclass(kw_only=True)
class PagePlug(Plug):
type = PlugType.PAGE
description: str
page: PagePlugInner
description: str | None = None

# noinspection PyUnusedLocal
def __rich_console__(self, console: Console, options: ConsoleOptions) -> RenderResult:
Expand Down

0 comments on commit 6c6b7b9

Please sign in to comment.