View Single Post
Old 01-20-2012, 10:45 AM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,109
Karma: 60406498
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by BeccaPrice View Post
Well, I'm doing this for a class project - and I'm not a programmer - so I'm going to need all the help I can get, Chaley - and thanks for the offer.

I read the tutorial, and I'm still confused. (is the template language based on python?) We're not going to include a lot of the template stuff in our document, only how to rename books with series and series number in it, but I would like to explain how the rule was constructed.

at another thread (
https://www.mobileread.com/forums/sho...60#post1926660) someone else posted the following rule:

{series}{series_index:| - | - }{title}

That does the same thing that my rule does, only in a slightly different order, and makes perfect sense to me although I'm not sure what the pipes and dashes mean. But it's a much simpler rule than mine has all the different kinds of brackets and such.

Chaley, would you be willing to put it into English for me? Thanks so very much.
I'll take a stab at it:
{} are a standard (listed) field/column name (you can't see Author_sort, series and series_index are shown concatenated...)
Pipes are "If-then-else" constructs that place the literal between in the relative position.

series_-_series_index_-_Title (NB I uses orange Underscores to show the spaces used in the template)

a slash (/) creates another folder inside

Here is a template I used on my reader (now, more complex and automates series treatment) that used filenames only in the book chooser, that shows the use of Literals and mixed in with field valued :
Code:
00NoSeries/{author_sort[0]}_authors/{authors}/{title}-{id}
00NoSeries is simply a folder I used to keep any book that did not belong to a series (stand alone books)

{author_sort[0]}_authors made a folder inside the above for the first initial of the Authors Last Name (my authors show Fn Ln): Mark Twain would create: Authors_T

{title}-{id} makes the book folder, showing the Calibre Library ID (simply there to help me spot duplicate or Alternate versions)

This was all done before Plug boards and programmatic templates
theducks is offline   Reply With Quote