From 1c8d6e7c73bfdb41d06a63de870e0d5f5de00a16 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 18 Aug 2010 10:11:52 -0600 Subject: [PATCH] SONY driver: Fix series order being lost when metadata management is set to manual --- src/calibre/devices/usbms/books.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/devices/usbms/books.py b/src/calibre/devices/usbms/books.py index cdba980642..959f26199c 100644 --- a/src/calibre/devices/usbms/books.py +++ b/src/calibre/devices/usbms/books.py @@ -181,7 +181,9 @@ class CollectionsBookList(BookList): if lpath not in collections_lpaths[category]: collections_lpaths[category].add(lpath) collections[category].append(book) - if attr == 'series': + if attr == 'series' or \ + ('series' in collection_attributes and + getattr(book, 'series', None) == category): series_categories.add(category) # Sort collections for category, books in collections.items():