Skip to content

Commit

Permalink
fix: ordering of assignment before super call
Browse files Browse the repository at this point in the history
  • Loading branch information
iPromKnight committed Nov 7, 2024
1 parent 2428c2b commit d0b6352
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/program/media/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def __init__(self, item: dict | None) -> None:
# Overseerr related
self.overseerr_id = item.get("overseerr_id")

#Post processing
# Post-processing
self.subtitles = item.get("subtitles", [])

@staticmethod
Expand Down Expand Up @@ -423,9 +423,9 @@ def copy(self, other):
return self

def __init__(self, item):
self.type = MovieMediaType.Movie.value
self.file = item.get("file", None)
super().__init__(item)
self.type = MovieMediaType.Movie.value

def __repr__(self):
return f"Movie:{self.log_string}:{self.state.name}"
Expand All @@ -445,11 +445,11 @@ class Show(MediaItem):
}

def __init__(self, item):
super().__init__(item)
self.type = ShowMediaType.Show.value
self.locations = item.get("locations", [])
self.seasons: list[Season] = item.get("seasons", [])
self.propagate_attributes_to_childs()
super().__init__(item)

def get_season_index_by_id(self, item_id):
"""Find the index of an season by its _id."""
Expand Down Expand Up @@ -563,7 +563,6 @@ def __init__(self, item):
self.type = ShowMediaType.Season.value
self.number = item.get("number", None)
self.episodes: list[Episode] = item.get("episodes", [])
self.parent = item.get("parent", None)
super().__init__(item)
if self.parent and isinstance(self.parent, Show):
self.is_anime = self.parent.is_anime
Expand Down Expand Up @@ -660,10 +659,10 @@ class Episode(MediaItem):
}

def __init__(self, item):
self.type = ShowMediaType.Episode.value
self.number = item.get("number", None)
self.file = item.get("file", None)
super().__init__(item)
self.type = ShowMediaType.Episode.value
if self.parent and isinstance(self.parent, Season):
self.is_anime = self.parent.parent.is_anime

Expand Down

0 comments on commit d0b6352

Please sign in to comment.