Exemplo n.º 1
0
    def show_search(self, query=None):
        """ Shows the search dialog.

        :param str query:               The query to search for.
        """
        if not query:
            # Ask for query
            query = kodiutils.get_search_string(
                heading=kodiutils.localize(30009))  # Search
            if not query:
                kodiutils.end_of_directory()
                return

        # Do search
        items = self._search_api.search(query)

        # Generate the results
        listing = []
        for item in items:
            if isinstance(item, Program):
                if item.series_id:
                    listing.append(Menu.generate_titleitem_series(item))
                else:
                    listing.append(Menu.generate_titleitem_program(item))

            if isinstance(item, Channel) and item.available is not False:
                listing.append(Menu.generate_titleitem_channel(item))

        # Sort like we get our results back.
        kodiutils.show_listing(listing, 30009, content='files')
Exemplo n.º 2
0
    def show_channel_replay(self, channel_id):
        """ Shows the replay programs of the specified channel.

        :param str channel_id:          The channel for which we want to show the replay programs.
        """
        programs = self._channel_api.get_replay(channel_id.split(':')[0])

        listing = []
        for item in programs:
            # Hide these items
            if item.title == EpgApi.EPG_NO_BROADCAST:
                continue

            if item.series_id:
                listing.append(Menu.generate_titleitem_series(item))
            else:
                listing.append(Menu.generate_titleitem_program(item))

        kodiutils.show_listing(listing,
                               30013,
                               content='tvshows',
                               sort=['label'])