View Single Post
Old 09-13-2012, 08:46 AM   #12
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
How to change author using a plugboard

In anticipation of your next question ...

To change the author for catalogs sent to your Kobo, do the following:

1. Create a Template Function
  • Open Preferences|Advanced|Template Functions
  • In the Function field, type change_author_if_catalog
  • Set Arg count to -1
  • Paste the following code into the Program Code field:
    Code:
    def evaluate(self, formatter, kwargs, mi, locals):
        for tag in kwargs.get('tags'):
            if tag == "Catalog":
                return "0-calibre"
        return mi.get('authors')[0]
    You can change 0-calibre to whatever author name you'd prefer.
  • Click the Create button
  • Click Apply to close the Template Functions dialog
  • Open Preferences|Import/Export|Metadata plugboards
  • In Add new plugboard, select EPUB as Format and KOBO as Device
  • In the Source template field, type:
    Code:
    program: change_author_if_catalog()
  • In the Destination field, select authors
  • Click Save plugboard, then Apply

When sending epubs to your Kobo, if the epub has a 'Catalog' tag, the author name will be replaced.

If this is the end result you're looking for, you can do something similar with the title. The only difference would be in the change_title_if_catalog function, the last line would be
Code:
    return mi.get('title')
G

Last edited by GRiker; 09-13-2012 at 08:52 AM.
GRiker is offline   Reply With Quote