|
|
|
@ -103,7 +103,7 @@ class ShowDetailsScreen(Screen):
|
|
|
|
|
|
|
|
|
|
if not self.__showDescriptor is None:
|
|
|
|
|
|
|
|
|
|
self.query_one("#id_wdg", Static).update(str(self.__showDescriptor.getId()))
|
|
|
|
|
self.query_one("#id_input", Static).update(str(self.__showDescriptor.getId()))
|
|
|
|
|
self.query_one("#name_input", Input).value = str(self.__showDescriptor.getName())
|
|
|
|
|
self.query_one("#year_input", Input).value = str(self.__showDescriptor.getYear())
|
|
|
|
|
|
|
|
|
@ -235,9 +235,9 @@ class ShowDetailsScreen(Screen):
|
|
|
|
|
# 2
|
|
|
|
|
yield Static("ID")
|
|
|
|
|
if not self.__showDescriptor is None:
|
|
|
|
|
yield Static("", id="id_wdg", classes="four")
|
|
|
|
|
yield Static("", classes="four")
|
|
|
|
|
else:
|
|
|
|
|
yield Input(type="integer", id="id_wdg", classes="four")
|
|
|
|
|
yield Input(type="integer", id="id_input", classes="four")
|
|
|
|
|
|
|
|
|
|
# 3
|
|
|
|
|
yield Static("Name")
|
|
|
|
@ -292,33 +292,33 @@ class ShowDetailsScreen(Screen):
|
|
|
|
|
if self.__showDescriptor:
|
|
|
|
|
kwargs[ShowDescriptor.ID_KEY] = int(self.__showDescriptor.getId())
|
|
|
|
|
else:
|
|
|
|
|
kwargs[ShowDescriptor.ID_KEY] = int(self.query_one("#id_wdg", Input).value)
|
|
|
|
|
kwargs[ShowDescriptor.ID_KEY] = int(self.query_one("#id_input", Input).value)
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
kwargs[ShowDescriptor.NAME_KEY] = str(self.query_one("#name_input", Input).value)
|
|
|
|
|
except TypeError:
|
|
|
|
|
except ValueError:
|
|
|
|
|
pass
|
|
|
|
|
try:
|
|
|
|
|
kwargs[ShowDescriptor.YEAR_KEY] = int(self.query_one("#year_input", Input).value)
|
|
|
|
|
except TypeError:
|
|
|
|
|
except ValueError:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
kwargs[ShowDescriptor.INDEX_SEASON_DIGITS_KEY] = int(self.query_one("#index_season_digits_input", Input).value)
|
|
|
|
|
except TypeError:
|
|
|
|
|
except ValueError:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
kwargs[ShowDescriptor.INDEX_EPISODE_DIGITS_KEY] = int(self.query_one("#index_episode_digits_input", Input).value)
|
|
|
|
|
except TypeError:
|
|
|
|
|
except ValueError:
|
|
|
|
|
pass
|
|
|
|
|
try:
|
|
|
|
|
kwargs[ShowDescriptor.INDICATOR_SEASON_DIGITS_KEY] = int(self.query_one("#indicator_season_digits_input", Input).value)
|
|
|
|
|
except TypeError:
|
|
|
|
|
except ValueError:
|
|
|
|
|
pass
|
|
|
|
|
try:
|
|
|
|
|
kwargs[ShowDescriptor.INDICATOR_EPISODE_DIGITS_KEY] = int(self.query_one("#indicator_episode_digits_input", Input).value)
|
|
|
|
|
except TypeError:
|
|
|
|
|
except ValueError:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
return ShowDescriptor(**kwargs)
|
|
|
|
|