'Called once books have been uploaded.'

def books_uploaded(self, job):

    (metadata, on_card, memory, files) = self.upload_memory.pop(job)
    if (job.exception is not None):
        if isinstance(job.exception, FreeSpaceError):
            where = ('in    main    memory.' if ('memory' in str(job.exception)) else 'on    the    storage    card.')
            titles = '\n'.join([(('<li>' + mi.title) + '</li>') for mi in metadata])
            d = error_dialog(self, _('No    space    on    device'), ((_('<p>Cannot    upload    books    to    device    there    is    no    more    free    space    available    ') + where) + ('</p>\n<ul>%s</ul>' % (titles,))))
            d.exec_()
        elif isinstance(job.exception, WrongDestinationError):
            error_dialog(self, _('Incorrect    destination'), unicode(job.exception), show=True)
        else:
            self.device_job_exception(job)
        return
    try:
        self.device_manager.add_books_to_metadata(job.result, metadata, self.booklists())
    except:
        traceback.print_exc()
        raise
    books_to_be_deleted = []
    if (memory and memory[1]):
        books_to_be_deleted = memory[1]
        self.library_view.model().delete_books_by_id(books_to_be_deleted)
    if (not self.set_books_in_library(self.booklists(), reset=True, add_as_step_to_job=job, do_device_sync=False)):
        self.upload_booklists(job)
    self.refresh_ondevice()
    view = (self.card_a_view if (on_card == 'carda') else (self.card_b_view if (on_card == 'cardb') else self.memory_view))
    view.model().resort(reset=False)
    view.model().research()
    if files:
        for f in files:
            try:
                rem = (not getattr(self.device_manager.device, 'KEEP_TEMP_FILES_AFTER_UPLOAD', False))
                if (rem and ('caltmpfmt.' in f)):
                    os.remove(f)
            except:
                pass
