def set_book_cover(self, qt_book_id, cover_local_filepath, qt_cover_filename): self.logger.debug(sys._getframe().f_code.co_name) response = RequestManager.create_file_request( "/api/storage/thumb/upload", {"source": "calibre"}, {"book_id": qt_book_id, "file_name": qt_cover_filename}, {"file": cover_local_filepath} # {'file':'/home/jason/Documents/Daulton, John/Galactic Mage, The/Galactic Mage, The - John Daulton.mobi'} ) self.logger.debug(response) return response
def create_bookstorage(self, qt_book_id, storage_type, local_filepath, qt_filename, replace_file=False): self.logger.debug(sys._getframe().f_code.co_name) qt_filename_base, qt_filename_ext = os.path.splitext(qt_filename) self.logger.debug(qt_filename_base, qt_filename_ext) response = RequestManager.create_file_request( "/api/storage/upload", {"source": "calibre"}, { "book_id": qt_book_id, "storage_type": storage_type, "file_name": qt_filename_base, "format": qt_filename_ext[1:], "replace_file": replace_file, }, {"file": local_filepath} # {'file':'/home/jason/Documents/Daulton, John/Galactic Mage, The/Galactic Mage, The - John Daulton.mobi'} ) self.logger.debug(response) return response