def html_create_data(self, read_only: bool = False) -> dict: """returns the data for html""" name = ConfigObjString( "disc_name", "", "Disc Name", "Enter the name of the Disc here", ) name.value = self.name if read_only: name.input_attributes = InputAttributes("readonly") info = ConfigObjString( "disc_info", "", "Disc Info", "Enter some information for the disc here", ) info.value = self.info if read_only: info.input_attributes = InputAttributes("readonly") language = ConfigObjOptionsSelect( "disc_language", Languages.config_option(ConfigObjOption), "en", "Disc Language", "Enter the language of the Disc here", ) language.value = self.language if read_only: language.input_attributes = InputAttributes("readonly") return { "search": False, "disc_type": self.disc_type, "disc_items": [ { "type": "hidden", "var_name": "disc_type", "value": self.disc_type, }, name.html_dict(""), info.html_dict(""), language.html_dict(""), ], }
def html_create_data(self, track_id: int, read_only: bool = False) -> dict: """returns the data for html""" name = ConfigObjString(f"track_{track_id}_name", "", "Extra Name", "Enter the name") if read_only: name.input_attributes = InputAttributes("readonly") name.value = self.name return { "disc_items": [ { "type": "hidden", "var_name": f"track_{track_id}_type", "value": self.track_type, }, name.html_dict(""), ], }
def html_create_data(self, track_id: int, read_only: bool = False) -> dict: """returns the data for html""" reason = ConfigObjString( f"track_{track_id}_reason", "", "Reason", "Enter the reason to not rip this at all here") if read_only: reason.input_attributes = InputAttributes("readonly") reason.value = self.reason return { "disc_items": [ { "type": "hidden", "var_name": f"track_{track_id}_type", "value": self.track_type, }, reason.html_dict(""), ], }
def html_create_data(self, read_only: bool = False) -> dict: """returns the data for html""" name = ConfigObjString( "name", "", "Movie Title", "Enter the name of the movie here", button=Button("Search By Title", "movieSearch", True, item_width=175), ) name.value = self.name year = ConfigObjIntegerNumber( "year", 0, "Year", "Enter the year here to help the search by title", input_attributes=InputAttributes(min=1888, max=int( datetime.date.today().year)), ) year.value = self.year imdbid = ConfigObjString( "imdbid", "", "IMDB ID", "Enter the IMDB ID here", button=Button("Search By IMDB ID", "movieSearchIMDBid", True, item_width=175), ) tmdbid = ConfigObjString( "tmdbid", "", "TMDB ID", "Enter the TMDB ID here", button=Button("Search By TMDB ID", "movieSearchTMDBid", True, item_width=175), ) tmdbid.value = self.tmdb_id year_html = year.html_dict("") year_html["value"] = "" return { "search": True, "disc_type": self.disc_type, "disc_data_items": [ { "type": "hidden", "var_name": "disc_type", "value": self.disc_type, }, { "type": "hidden", "var_name": "disc_tmdbid", "value": self.tmdb_id, }, { "type": "hidden", "var_name": "disc_name", "value": self.name, }, { "type": "hidden", "var_name": "disc_year", "value": self.year, }, { "type": "hidden", "var_name": "disc_language", "value": self.language, }, ], "disc_items": [ name.html_dict(""), year_html, imdbid.html_dict(""), tmdbid.html_dict(""), ], }
def html_create_data(self, read_only: bool = False) -> dict: """returns the data for html""" name = ConfigObjString( "name", "", "TV Show Name", "Enter the name of the TV Show here", button=Button("Search By Title", "tvSearch", True, item_width=175), ) name.value = self.name tvdbid = ConfigObjString( "tvdbid", "", "TVDB ID", "Enter the TVDB ID here", button=Button("Search By TVDB ID", "tvSearchTVDBid", True, item_width=175), ) imdbid = ConfigObjString( "imdbid", "", "IMDB ID", "Enter the IMDB ID here", button=Button("Search By IMDB ID", "tvSearchIMDBid", True, item_width=175), ) tmdbid = ConfigObjString( "tmdbid", "", "TMDB ID", "Enter the TMDB ID here", button=Button("Search By TMDB ID", "tvSearchTMDBid", True, item_width=175), ) tmdbid.value = self.tmdb_id return { "search": True, "disc_type": self.disc_type, "disc_data_items": [ { "type": "hidden", "var_name": "disc_type", "value": self.disc_type, }, { "type": "hidden", "var_name": "disc_tmdbid", "value": self.tmdb_id, }, { "type": "hidden", "var_name": "disc_name", "value": self.name, }, { "type": "hidden", "var_name": "disc_language", "value": self.language, }, ], "disc_items": [ name.html_dict(""), tvdbid.html_dict(""), imdbid.html_dict(""), tmdbid.html_dict(""), ], }