mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #7486 (Custom Recipes not sorted by title in "Add Custom News")
This commit is contained in:
commit
965be167dc
@ -61,8 +61,9 @@ def serialize_recipe(urn, recipe_class):
|
||||
|
||||
def serialize_collection(mapping_of_recipe_classes):
|
||||
collection = E.recipe_collection()
|
||||
for urn, recipe_class in mapping_of_recipe_classes.items():
|
||||
recipe = serialize_recipe(urn, recipe_class)
|
||||
for urn in sorted(mapping_of_recipe_classes.keys(),
|
||||
key=lambda key: mapping_of_recipe_classes[key].title):
|
||||
recipe = serialize_recipe(urn, mapping_of_recipe_classes[urn])
|
||||
collection.append(recipe)
|
||||
collection.set('count', str(len(collection)))
|
||||
return etree.tostring(collection, encoding='utf-8', xml_declaration=True,
|
||||
|
Loading…
x
Reference in New Issue
Block a user