Skip to content

Commit 195ba05

Browse files
Handle when seasons name is None
Update dependencies
1 parent c462dd2 commit 195ba05

5 files changed

Lines changed: 51 additions & 44 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.11.11
3+
rev: v0.11.12
44
hooks:
55
- id: ruff-format
66
- id: ruff-check

mediux_posters/mediux/schemas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Season(MediuxModel):
5454
episodes: list[Episode]
5555
id: int
5656
number: int = Field(alias="season_number")
57-
title: str = Field(alias="season_name")
57+
title: str | None = Field(alias="season_name", default=None)
5858

5959

6060
class Show(MediuxModel):

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ dev = [
77
"pre-commit >= 4.2.0"
88
]
99
tests = [
10-
"pytest >= 8.3.5",
10+
"pytest >= 8.4.0",
1111
"pytest-cov >= 6.1.1",
1212
"pytest-httpx >= 0.35.0",
1313
"tox >= 4.26.0",
14-
"tox-uv >= 1.25.0"
14+
"tox-uv >= 1.26.0"
1515
]
1616

1717
[project]
@@ -37,7 +37,7 @@ dependencies = [
3737
"rich >= 14.0.0",
3838
"tomli >= 2.2.1 ; python_version < '3.11'",
3939
"tomli-w >= 1.2.0",
40-
"typer >= 0.15.4"
40+
"typer >= 0.16.0"
4141
]
4242
description = "Fetches Show, Movie, and Collection cover art from Mediux and updates Plex/Jellyfin using TMDB IDs."
4343
dynamic = ["version"]

tests/mediux_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from mediux_posters.mediux import Mediux
77
from mediux_posters.mediux.schemas import FileType
8+
from mediux_posters.utils import MediaType
89

910

1011
def test_list_show_sets(mediux_session: Mediux) -> None:
@@ -169,3 +170,8 @@ def test_download_image(mediux_session: Mediux) -> None:
169170
assert compute_file_hash(expected_image) == compute_file_hash(output_file), (
170171
"Downloaded image does not match expected image"
171172
)
173+
174+
def test_season_name_none(mediux_session: Mediux) -> None:
175+
results = mediux_session.list_sets(media_type=MediaType.SHOW, tmdb_id=95479)
176+
assert len(results) != 0
177+
assert results[0].show.seasons[2].title is None

0 commit comments

Comments
 (0)