View Single Post
Old 02-29-2012, 08:08 PM   #15
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
You'll notice, this post is very long, however it's a one-time task. Once you've set everything up you can forget about it... unless you WANT to change things, of course

As you've probably realised by now Calibre has an awful lot of features. Some of the most powerful are not immediately obvious. In addition, the more advanced features are very powerful so I won't even attempt to cover it all.

What I'll do in this post is to detail, from start to finish, the steps necessary to let Calibre manage all the Collections, sort sequences and metadata on your Sony reader. Rather than confuse you by discussing too many generalities, I'll use the way I manage my own Sonys as a worked example, where:
  • most important book metadata is Author, Series_name/index, Title and Calibre tags
  • major sort sequence is Author/Series_name/Series_index/Title
This scenario may not be exactly what you want, but once you have it set up you can fine-tune settings so you DO get what you want. At least you'll know which parts of Calibre to investigate further. The combination of Calibre and Sony readers is just about the best there is at the moment.

I'm not sure which Sony models you have. The following instructions are for PRS505/PRS300/PRS350/PRS650/PRS950 and PRST1. The PRST1 has some extra considerations so I'll point those out where necessary. (Instructions may also be suitable for PRS600, but as I don't have one I can't be sure)
  1. In Prefs - Sending books to device, set 'Metadata management' box to Automatic.
    Read the help underneath the box for info on what each setting means. It's important to understand a setting of 'Automatic' means that Calibre is expecting you to do ALL your metadata changes in Calibre, not manually on the Sony. Calibre will handle any necessary changes on the Sony next time you connect.
  2. Define how you want to CREATE Sony Collections
    You do this by customising the relevant 'device interface plugin' which is accessed via either
    Prefs - Plugins - Device Interface - SONY PRST1 - Customize for the T1 or
    Prefs - Plugins - Device Interface - SONY - Customize for all earlier models
    The box you want is labelled 'Comma-separated list of metadata fields...' I've set mine as a simple tags

    Some people also like to have a Collection per Series and/or a Collection per Author. In which case you need to set the box to list all the fields you want to use to create Collections on the device.

    A consideration about Calibre Tags...
    If you're going to use them to define Collections you may need to be careful how you populate this Calibre column. Personally, I do not download my Tags from metadata sites like Amazon. For instance if a book is a thriller set in New York about a Polish girl with a dog I don't want the Calibre Tags field set as 'Fiction, Thriller, Feminist literature, Poland, Canine, USA comtemporary, New York' otherwise that one book will be listed under 7 different Collections on the device. If you download from Amazon this is the sort of entry you will get in the Tags field. It gets out of hand. I would manually set the Tags field to simple 'Thriller'.
    However, some people like to have all these detailed Tags so they choose instead to add a new Calibre custom column (e.g. called genre). So they let Amazon populate the Tags field with as many entries as it likes and they manually populate their own Calibre 'genre' field with 'Thriller'. In this case they would set the box which defines Collections to #genre instead of tags.
  3. Define how you want to SORT Sony Collections
    Now you need to setup a Calibre Tweak to control the order in which the books appear within your Sony Collections. This is a 2-part thing.
    • First add a custom column to Calibre using Prefs - Add your own columns - add (the green plus icon).
      Using Calibre's template language you can construct pretty much any template you like in here. I keep it fairly simple and use:
      Lookup name: sonysort (any lowercase name, avoid spaces)
      Column heading: Sony_sort (anything you like)
      Column type: Column built from other columns
      Template: {author_sort}{series:| - | }{series_index:0>2s} - {title}
      Sort/search col by: Text
      Show in tags browser: unchecked
      Show as html...: unchecked
    • Set the Sony Tweak in Prefs - Tweaks - Specify how SONY collections are sorted
      (The above new custom column will handle book Series where Series_index is 0-99. See end of post ** for a few alternative options if this is not adequate for your Series requirements.)
      In the bottom tweak window tell Calibre to use your new custom column, i.e.
      Code:
      sony_collection_sorting_rules = [(['*'], '#sonysort')]
      which basically says, sort all Collections the same way namely as,
      author_sort - series_name series_index - title (e.g Christie, Agatha - Hercule Poirot 15 - Death on the Nile)

      If you want to create Collections from fields other than just Tags you have the option to sort each type of Collection in a different way. The flexibility is enormous and you will need to read the help in the top tweak window to decide what's best for you.

Display Series metadata on Sony using Metadata Plugboard
Items 1-3 are enough to manage Collections on your device when using the 'Sort by Added Order' view option. However, you will notice that although all books in a Collection may be correctly sorted by, author_sort/series_name /series_index/title it is not immediately obvious because each book only displays a simple Author and Title -- the Series info is not visible on the Sony. This is where Calibre's Metadata Plugboard feature comes in.

If you want to display Series info you've got to combine it with either the Sony Author or Title field. I've chosen to suffix it to Author for 2 reasons:
  • The font is smaller so you can get more chars on the line without running off the right edge
  • When viewing the full booklist (not Collections) by Author, the books should appear in Author/Series order. (Unfortunately, on a PRST1, this is not 100% reliable)

The following describes the Calibre Metadata Plugboard necessary so that all Sony book lists look like one of the attached images (PRS505.jpg or PRS650.jpg). I don't have a screencap utility on my PRST1, but it looks similar to the PRS650 image.
  1. For PRS505/x50: open Prefs - Metadata Plugboard
    In 'add new plugboard'
    Format: device_db
    Device: PRS505
    Source template1: {author_sort}{series:| - | }{series_index:0>2s}
    Destination1: authors
    Source template2: {series}{series_index:0>2s|| - }{title}
    Destination2: title_sort
    Press 'Save plugboard' button
    press 'Apply' button
  2. For PRST1: you need 2 plugboards, open Prefs - Metadata Plugboard
    In 'add new plugboard'
    Format: device_db
    Device: PRST1
    Source template: {author_sort}{series:| - | }{series_index:0>2s}
    Destination: authors
    Press 'Save plugboard' button
    back to 'add new plugboard' for 2nd
    Format: epub
    Device: PRST1
    Source template: {author_sort}{series:| - | }{series_index:0>2s}
    Destination: authors
    Press 'Save plugboard' button
    press 'Apply' button

    In each case, the device_db plugboard writes your current Calibre metadata directly into the Sony's book database every time you connect the Sony to Calibre. The beauty of this is that any changes you make to Calibre metadata will automatically be updated on the Sony next time you connect -- no need to resend the books.

    [In case you're wondering why the PRST1 needs the 2nd plugboard (the epub one) -- it's because, for some unknown reason, sometimes after connecting it to Calibre, the T1 decides to update its book database by re-reading all the metadata inside each book. The 2nd plugboard makes an effort (for epubs at least) to make the data it re-reads the same as the data it just threw away. However, the epub plugboard is only used when you send the book to the PRST1, not every time you connect T1 to Calibre.]

    Just a caveat here... if you're using a metadata plugboard to remap the Sony's Author field then you should make sure that Prefs - Plugins - Device Interface - Sony (or SONY PRST1) - Customize - Use author sort for author is UNCHECKED. Otherwise your plugboard info will be overwritten by the simple author_sort field.

** Alternate options for displaying Series info
Using an example of a book with
Author: Agatha Christie
Series: Hercule Poirot[15]
Title: Death on the Nile
The Calibre template used in the previous discussion
Code:
{author_sort}{series:| - | }{series_index:0>2s} - {title}
results in: Christie, Agatha - Hercule Poirot 15 - Death on the Nile

For very large book series:
Code:
{author_sort}{series:| - | }{series_index:0>3s} - {title}
results in: Christie, Agatha - Hercule Poirot 015 - Death on the Nile

For complex series, with index needing decimal point e.g. prequels or short stories between "normal" books in the series:
Code:
{author_sort}{series:| - | }{series_index:0>5.2f} - {title}
results in: Christie, Agatha - Hercule Poirot 15.00 - Death on the Nile
or perhaps
Code:
{author_sort}{series:| - | }{series_index:0>5.1f} - {title}
results in: Christie, Agatha - Hercule Poirot 015.0 - Death on the Nile

... so pick the {series_index:...} part of the template which best suits your needs and use it throughout this exercise.

...well I think that's more than enough for a first draft. See if you can make sense of it and let me know
Attached Thumbnails
Click image for larger version

Name:	prs505.jpg
Views:	1979
Size:	61.5 KB
ID:	83246   Click image for larger version

Name:	prs650.jpg
Views:	2005
Size:	54.3 KB
ID:	83247  

Last edited by jackie_w; 02-29-2012 at 08:19 PM. Reason: clarification
jackie_w is offline   Reply With Quote