ff
This commit is contained in:
@@ -37,49 +37,49 @@ class ShowDescriptor():
|
||||
raise TypeError(f"ShowDescriptor.__init__(): Argument {ShowDescriptor.ID_KEY} is required to be of type int")
|
||||
self.__showId = kwargs[ShowDescriptor.ID_KEY]
|
||||
else:
|
||||
self.__showId = {}
|
||||
self.__showId = -1
|
||||
|
||||
if ShowDescriptor.NAME_KEY in kwargs.keys():
|
||||
if type(kwargs[ShowDescriptor.NAME_KEY]) is not str:
|
||||
raise TypeError(f"ShowDescriptor.__init__(): Argument {ShowDescriptor.NAME_KEY} is required to be of type str")
|
||||
self.__showName = kwargs[ShowDescriptor.NAME_KEY]
|
||||
else:
|
||||
self.__showName = {}
|
||||
self.__showName = ''
|
||||
|
||||
if ShowDescriptor.YEAR_KEY in kwargs.keys():
|
||||
if type(kwargs[ShowDescriptor.YEAR_KEY]) is not int:
|
||||
raise TypeError(f"ShowDescriptor.__init__(): Argument {ShowDescriptor.YEAR_KEY} is required to be of type int")
|
||||
self.__showYear = kwargs[ShowDescriptor.YEAR_KEY]
|
||||
else:
|
||||
self.__showYear = {}
|
||||
self.__showYear = -1
|
||||
|
||||
if ShowDescriptor.INDEX_SEASON_DIGITS_KEY in kwargs.keys():
|
||||
if type(kwargs[ShowDescriptor.INDEX_SEASON_DIGITS_KEY]) is not int:
|
||||
raise TypeError(f"ShowDescriptor.__init__(): Argument {ShowDescriptor.INDEX_SEASON_DIGITS_KEY} is required to be of type int")
|
||||
self.__indexSeasonDigits = kwargs[ShowDescriptor.INDEX_SEASON_DIGITS_KEY]
|
||||
else:
|
||||
self.__indexSeasonDigits = {}
|
||||
self.__indexSeasonDigits = -1
|
||||
|
||||
if ShowDescriptor.INDEX_EPISODE_DIGITS_KEY in kwargs.keys():
|
||||
if type(kwargs[ShowDescriptor.INDEX_EPISODE_DIGITS_KEY]) is not int:
|
||||
raise TypeError(f"ShowDescriptor.__init__(): Argument {ShowDescriptor.INDEX_EPISODE_DIGITS_KEY} is required to be of type int")
|
||||
self.__indexEpisodeDigits = kwargs[ShowDescriptor.INDEX_EPISODE_DIGITS_KEY]
|
||||
else:
|
||||
self.__indexEpisodeDigits = {}
|
||||
self.__indexEpisodeDigits = -1
|
||||
|
||||
if ShowDescriptor.INDICATOR_SEASON_DIGITS_KEY in kwargs.keys():
|
||||
if type(kwargs[ShowDescriptor.INDICATOR_SEASON_DIGITS_KEY]) is not int:
|
||||
raise TypeError(f"ShowDescriptor.__init__(): Argument {ShowDescriptor.INDICATOR_SEASON_DIGITS_KEY} is required to be of type int")
|
||||
self.__indicatorSeasonDigits = kwargs[ShowDescriptor.INDICATOR_SEASON_DIGITS_KEY]
|
||||
else:
|
||||
self.__indicatorSeasonDigits = {}
|
||||
self.__indicatorSeasonDigits = -1
|
||||
|
||||
if ShowDescriptor.INDICATOR_EPISODE_DIGITS_KEY in kwargs.keys():
|
||||
if type(kwargs[ShowDescriptor.INDICATOR_EPISODE_DIGITS_KEY]) is not int:
|
||||
raise TypeError(f"ShowDescriptor.__init__(): Argument {ShowDescriptor.INDICATOR_EPISODE_DIGITS_KEY} is required to be of type int")
|
||||
self.__indicatorEpisodeDigits = kwargs[ShowDescriptor.INDICATOR_EPISODE_DIGITS_KEY]
|
||||
else:
|
||||
self.__indicatorEpisodeDigits = {}
|
||||
self.__indicatorEpisodeDigits = -1
|
||||
|
||||
|
||||
def getId(self):
|
||||
|
||||
@@ -294,14 +294,32 @@ class ShowDetailsScreen(Screen):
|
||||
else:
|
||||
kwargs[ShowDescriptor.ID_KEY] = int(self.query_one("#id_wdg", Input).value)
|
||||
|
||||
|
||||
kwargs[ShowDescriptor.NAME_KEY] = str(self.query_one("#name_input", Input).value)
|
||||
kwargs[ShowDescriptor.YEAR_KEY] = int(self.query_one("#year_input", Input).value)
|
||||
|
||||
kwargs[ShowDescriptor.INDEX_SEASON_DIGITS_KEY] = int(self.query_one("#index_season_digits_input", Input).value)
|
||||
kwargs[ShowDescriptor.INDEX_EPISODE_DIGITS_KEY] = int(self.query_one("#index_episode_digits_input", Input).value)
|
||||
kwargs[ShowDescriptor.INDICATOR_SEASON_DIGITS_KEY] = int(self.query_one("#indicator_season_digits_input", Input).value)
|
||||
kwargs[ShowDescriptor.INDICATOR_EPISODE_DIGITS_KEY] = int(self.query_one("#indicator_episode_digits_input", Input).value)
|
||||
try:
|
||||
kwargs[ShowDescriptor.NAME_KEY] = str(self.query_one("#name_input", Input).value)
|
||||
except TypeError:
|
||||
pass
|
||||
try:
|
||||
kwargs[ShowDescriptor.YEAR_KEY] = int(self.query_one("#year_input", Input).value)
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
try:
|
||||
kwargs[ShowDescriptor.INDEX_SEASON_DIGITS_KEY] = int(self.query_one("#index_season_digits_input", Input).value)
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
try:
|
||||
kwargs[ShowDescriptor.INDEX_EPISODE_DIGITS_KEY] = int(self.query_one("#index_episode_digits_input", Input).value)
|
||||
except TypeError:
|
||||
pass
|
||||
try:
|
||||
kwargs[ShowDescriptor.INDICATOR_SEASON_DIGITS_KEY] = int(self.query_one("#indicator_season_digits_input", Input).value)
|
||||
except TypeError:
|
||||
pass
|
||||
try:
|
||||
kwargs[ShowDescriptor.INDICATOR_EPISODE_DIGITS_KEY] = int(self.query_one("#indicator_episode_digits_input", Input).value)
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
return ShowDescriptor(**kwargs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user