Quote:
Originally Posted by Phssthpok
Looking at the Calibre Kobo driver, it talks about turning series into collections. Will it work equally if you choose tags instead of series (esp. since a book may have multiple tags)?
|
You should not have any problem using tags instead of genres, or in addition to genres. In the driver settings (true for both the KoboTouch and KoboTouchExtended drivers), you can even visit the “Collections, covers & uploads” settings tab and use the “Collections template” field to set up arbitrarily powerful custom processing. For instance, if you only wanted a collection for a specific tag, then you could do something like:
Code:
program: tag = "My Super Special Collection Tag"; if tag in $tags then tag fi;
This is a *very* simplistic example and if you want to do something more powerful then you may wish to save a template function and call your saved template function from the “Collections template” field. (For a similar example, I have a complicated template function which automatically spits out a list of to-dos based on incomplete metadata; then I have a custom column built from other columns whose template is simply:
You could similarly make a complex saved template function and then in your Collections template simply reference it like:
Code:
{:kobocollections()}
(or whatever you wish to name your saved template function in place of “kobocollections”, a totally arbitrary name I just made up).
If this is a road you wish to go down and you wish to be able to produce more than one collection from this template function, then by carefully reading the tooltip for the “Collections template” input field, which mentions joining separate collection names with
:@:, we can infer that the
list_join() function will be of great help to you. Example:
Code:
program:
tag1 = "Obviously you would do some processing here";
tag2 = "Rather than just hardcoding some nonsense tags";
tag3 = "But hopefully this illustrates the point";
list_join(':@:', tag1, ':@:', tag2, ':@:', tag3, ':@:')
(This function accepts a variable number of arguments, you don't HAVE to use it with 3 tags. And you can use it to join existing lists, rather than simply joining single elements together into a list, as I've done here.)
Fine, here's one more example with slightly more practical code, heavily commented for readability:
Code:
program:
# Set up basic variables.
collections = "";
sep = ":@:";
# Set up custom information.
tag1 = "My Super Special Tag Name";
field_to_flag_if_missing = $#super_important_custom_column;
# Process our custom rules, adding each qualifying result to the list of collections as we go.
if tag1 in $tags then collections = list_join(sep, collections, sep, tag1, sep) fi;
if !field_to_flag_if_missing then collections = list_join(sep, collections, sep, "Change this to a custom name for your collection assigned to the books with this missing field", sep);
# Return the final value of our collections list.
collections
Depending on how comfortable you are with programming concepts, I think chances are good that I've either inspired you as to how flexible the KoboTouch[Extended] driver is for managing collections – or possibly completely overwhelmed you with complexity. If it's the latter, do feel free to ask questions!