calibre: e-book management

Comment 4 for bug 951063

Tomáš Pěnička (tom-penicka) wrote :

Hello Kovid,
  thank you for releasing the change, but it still doesn't work. There are 2 reasons:
1. There is a typo
2. Authors should be filled as an array into the function do_add.
Changes needed (file src/calibre/library/cli.py):

Ad 1:
The lines (function do_add, somewhere around line 238)
            for x in ('title', 'authors', 'isbn', 'tags', 'series'):
                val = locals()['o'+x]
                if val: setattr(mi, x[1:], val)
            if oseries:
                mi.series_index = oseries_index

Should be

            for x in ('title', 'authors', 'isbn', 'tags', 'series', 'series_index'):
                val = locals()['o'+x]
                if val: setattr(mi, x, val)
(notice the added series_index on the first line and change x[1:] to x on the last line)

Ad 2:
The lines (function command_add, somewhere around line 359)

    do_add(get_db(dbpath, opts), args[1:], opts.one_book_per_directory,
            opts.recurse, opts.duplicates, opts.title, opts.authors, opts.isbn,
            tags, opts.series, opts.series_index)

Should be

    do_add(get_db(dbpath, opts), args[1:], opts.one_book_per_directory,
            opts.recurse, opts.duplicates, opts.title, aut, opts.isbn,
            tags, opts.series, opts.series_index)
(change opts.authors to aut)

(Today I had a day of the Great On-Turning, when I launched the import of rather bigger number of ebooks, so I realised that the import doesn't work as I need. The workaround is the same as I mentioned earlier)

Cheers,

Tomas