Changes to the sony auto-collections tweak requested by Kovid. Also take the author_sort from the device_db plugboard, if it is available.

This commit is contained in:
Charles Haley 2010-12-21 20:37:19 +00:00
parent da75ab440a
commit d7986e12ba
2 changed files with 21 additions and 14 deletions

View File

@ -180,22 +180,22 @@ sony_collection_renaming_rules={}
# Default: empty (no rules), so no collection attributes are named. # Default: empty (no rules), so no collection attributes are named.
sony_collection_sorting_rules = [] sony_collection_sorting_rules = []
# Specify whether special collections are to be made. The two available are # Specify whether special collections are to be made. This option is primarily
# all_by_author and all_by_title. These collections work around various device # of use on a Sony. The two available are all_by_author and all_by_title. These
# idiosyncrasies regarding sorting of lists. The all by author collection is # collections work around various device idiosyncrasies regarding sorting of
# sorted by author(s) then title. The by title collection is sorted by title # lists, especially the sony *50 models. The author collection is sorted by
# then authors(s) # author(s) then title. The title collection is sorted by title then authors(s)
# Enable a collection by entering a collection name in the variable. That # Enable a collection by entering a collection name in the variable. That
# collection name must be unique. # collection name must be unique.
# Examples: # Examples:
# sony_all_books_by_author_collection = '%All by author' # device_special_collections = {'title':'', 'author':'%All by author'}
# create a collection of all books sorted by author # create a collection named '%All by author' of all books sorted by author
# sony_all_books_by_title_collection = '%All by title' # device_special_collections = {'title':'%All by title', 'author':''}
# create a collection of books sorted by title, respecting the order tweaks # create a collection named '%All by title' of books sorted by title,
# sony_all_books_by_author_collection = '' # respecting the order tweaks
# sony_all_books_by_author_collection = {'title':'', 'author':''}
# disable the collection # disable the collection
sony_all_books_by_author_collection = '' device_special_collections = {'title':'', 'author':''}
sony_all_books_by_title_collection = ''
# Create search terms to apply a query across several built-in search terms. # Create search terms to apply a query across several built-in search terms.

View File

@ -133,8 +133,15 @@ class CollectionsBookList(BookList):
collections = {} collections = {}
all_by_author = tweaks['sony_all_books_by_author_collection'] # get the special collection names
all_by_title = tweaks['sony_all_books_by_title_collection'] try:
all_by_author = tweaks['device_special_collections']['author']
except:
all_by_author = ''
try:
all_by_title = tweaks['device_special_collections']['title']
except:
all_by_title = ''
for book in self: for book in self:
tsval = book.get('_pb_title_sort', tsval = book.get('_pb_title_sort',