Quote:
Originally Posted by chaley
Did it add any txt formats?
EDIT: you didn't specify your library correctly.
Change the program to the following, being sure that the path to the library is correct.
Code:
def init_cache(library_path):
from calibre.db.backend import DB
from calibre.db.cache import Cache
backend = DB(library_path)
cache = Cache(backend)
cache.init()
return cache
print('Starting adding txt formats')
import tempfile
temporary_txt_file = tempfile.NamedTemporaryFile(suffix='txt', delete=False)
cache = init_cache(library_path = 'C:\\Users\\Jenny\\Documents\\Calibre Library')
print('Starting loop')
for id in cache.all_book_ids():
cache.add_format(id, 'TXT', temporary_txt_file)
print('Finished')
When you run the script you should see some output from the three print() statements.
|
ohh I see what you mean

, let me have another go. If this ever works i'll write up some notes!