code: def finish(self, items=None, sort_methods=None, succeeded=True,
                 update_listing=False, cache_to_disc=True, view_mode=None):
          '''Adds the provided items to the XBMC interface.
          :param items: an iterable of items where each item is either a
              dictionary with keys/values suitable for passing to
              :meth:`xbmcswift2.ListItem.from_dict` or an instance of
              :class:`xbmcswift2.ListItem`.
          :param sort_methods: a list of valid XBMC sort_methods. Each item in
                               the list can either be a sort method or a tuple of
                               ``sort_method, label2_mask``. See
                               :meth:`add_sort_method` for
                               more detail concerning valid sort_methods.
                               Example call with sort_methods::
                                  sort_methods = ['label', 'title', ('date', '%D')]
                                  plugin.finish(items, sort_methods=sort_methods)
          :param view_mode: can either be an integer (or parseable integer
              string) corresponding to a view_mode or the name of a type of view.
              Currrently the only view type supported is 'thumbnail'.
          :returns: a list of all ListItems added to the XBMC interface.
          '''
          if items:
              self.add_items(items)
          if sort_methods:
              for sort_method in sort_methods:
                  if not isinstance(sort_method, basestring) and hasattr(sort_method, '__len__'):
                      self.add_sort_method(*sort_method)
                  else:
                      self.add_sort_method(sort_method)
          if view_mode is not None:
              try:
                  view_mode_id = int(view_mode)
              except ValueError:
                  view_mode_id = self.get_view_mode_id(view_mode)
              if view_mode_id is not None:
                  self.set_view_mode(view_mode_id)
          self.end_of_directory(succeeded, update_listing, cache_to_disc)
          return self.added_items