Skip to content

Commit ff32d47

Browse files
committed
[671] Fix creating episodes via the FE/API
Fix creating new episodes with default fields
1 parent 9d26686 commit ff32d47

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

backend/.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2.0-alpha.15.0-webui670
1+
v2.0-alpha.15.0-webui671

backend/app/api/v2/episodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def add_new_episode(
7777
series = get_series(db, new_episode.series_id, raise_exc=True)
7878

7979
# Get dictionary of object and all associated Templates
80-
new_episode_dict = new_episode.dict()
80+
new_episode_dict = new_episode.model_dump(exclude_unset=True)
8181
templates = get_all_templates(db, new_episode_dict)
8282

8383
# Create new entry, add to database

backend/app/models/episode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ class Episode(Base):
101101
font_interword_spacing: Mapped[int | None]
102102
font_vertical_shift: Mapped[int | None]
103103

104-
emby_id: Mapped[str]
104+
emby_id: Mapped[str] = mapped_column(String, default='')
105105
imdb_id: Mapped[str | None]
106-
jellyfin_id: Mapped[str]
106+
jellyfin_id: Mapped[str] = mapped_column(String, default='')
107107
tmdb_id: Mapped[int | None]
108108
tvdb_id: Mapped[int | None]
109109
tvrage_id: Mapped[int | None]

backend/app/schemas/episode.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ class NewEpisode(Base):
2828
match_title: bool | None = None
2929
auto_split_title: bool | None = None
3030

31-
card_type: str | None
32-
hide_season_text: bool | None
33-
season_text: str | None
34-
hide_episode_text: bool | None
35-
episode_text: str | None
36-
unwatched_style: Style | None
37-
watched_style: Style | None
31+
card_type: str | None = None
32+
hide_season_text: bool | None = None
33+
season_text: str | None = None
34+
hide_episode_text: bool | None = None
35+
episode_text: str | None = None
36+
unwatched_style: Style | None = None
37+
watched_style: Style | None = None
3838

3939
font_color: str | None = None
4040
font_size: Annotated[float, Field(ge=0.0)] | None = None

0 commit comments

Comments
 (0)