def updateResults(self, forward=None):

        """
        Reload search results or load another "page".

        Parameters
        ----------
        forward : bool or None, optional
            Whether move forwards or backwards (``True`` or ``False``). If ``None``, then first page is loaded.
        """

        # this choses data we need.
        files = lambda x: {
            i['snippet']['title'].replace('/', '\\'): YTStor(
                {'yid': i['id']['videoId'], 'pub_date': i['snippet']['publishedAt']},
                opts=self.yts_opts) for i in x['items']
        }
        descs = lambda x: {
            (i['snippet']['title'].replace('/', '\\') + '.txt'): YTMetaStor(
                {
                    'title': i['snippet']['title'],
                    'yid': i['id']['videoId'],
                    'desc': i['snippet']['description'],
                    'channel': i['snippet']['channelTitle'],
                    'pub_date': i['snippet']['publishedAt']
                },
                opts=dict()
            ) for i in x['items']
        }
        thumbs = lambda x: {
            (i['snippet']['title'].replace('/', '\\') + '.jpg'): YTMetaStor(
                {'url': i['snippet']['thumbnails']['high']['url'], 'pub_date': i['snippet']['publishedAt']}, opts=dict()
            ) for i in x['items']
        }

        try:
            if self.adj_tokens[forward] is None: # in case someone would somehow cross boundary.
                forward = None
        except KeyError:
            pass

        recv = None
        try:
            try:
                data = self.avail_files[ self.adj_tokens[forward] ] # maybe data is already available locally.
            except __HOLE__:
                recv = self.__search( self.adj_tokens[forward] ) # nope, we have to search.
        except KeyError: # wrong index in adj_tokens

            if forward is None:
                recv = self.__search()
            else:
                raise ValueError("Valid values for forward are True, False or None (default).")

        if recv is not None:

            _d = files(recv)
            if self.preferences['metadata']['desc']: _d.update(descs(recv))
            if self.preferences['metadata']['thumb']: _d.update(thumbs(recv))

            data = (None, _d) # little format unification.

        if len(self.avail_files) > 4:

            pop = self.avail_files.popitem(False) # get rid of the oldest data.
            for s in pop[1][1].values(): s.clean()

        adj_t = deepcopy(self.adj_tokens) # this will we write to avail_files, now we update self.adj_tokens.

        if data[0] is None: # get tokens from obtained results.
            try:
                self.adj_tokens[False] = recv['prevPageToken']
            except KeyError:
                self.adj_tokens[False] = None

            try:
                self.adj_tokens[True] = recv['nextPageToken']
            except KeyError:
                self.adj_tokens[True] = None

        else: # already in avail_files.
            self.adj_tokens = data[0]

        if forward is not None:
            # backup last results in avail_files:
            self.avail_files[ self.adj_tokens[not forward] ] = (adj_t, self.visible_files)

        self.visible_files = data[1]
dataset/ETHPy150Open rasguanabana/ytfs/ytfs/actions.py/YTActions.updateResults