From 8525faf60c91956f9a311656bac6cd349348eacb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 28 Jun 2010 11:22:53 -0600 Subject: [PATCH] Fix #6018 (Updated recipe for The Old New Thing blog) and fix regression in metadata download that could cause errors with some books --- resources/recipes/oldnewthing.recipe | 4 ++-- src/calibre/ebooks/metadata/fetch.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/recipes/oldnewthing.recipe b/resources/recipes/oldnewthing.recipe index fc9749d403..8280451e17 100644 --- a/resources/recipes/oldnewthing.recipe +++ b/resources/recipes/oldnewthing.recipe @@ -28,7 +28,7 @@ class OldNewThing(BasicNewsRecipe): } remove_attributes = ['width','height'] - keep_only_tags = [dict(attrs={'class':['postsub','comment']})] - + keep_only_tags = [dict(attrs={'class':'full-post'})] + remove_tags = [dict(attrs={'class':['post-attributes','post-tags','post-actions']})] feeds = [(u'Posts', u'http://blogs.msdn.com/oldnewthing/rss.xml')] diff --git a/src/calibre/ebooks/metadata/fetch.py b/src/calibre/ebooks/metadata/fetch.py index 8b82d3c972..cb75d93f59 100644 --- a/src/calibre/ebooks/metadata/fetch.py +++ b/src/calibre/ebooks/metadata/fetch.py @@ -313,6 +313,8 @@ def search(title=None, author=None, publisher=None, isbn=None, isbndb_key=None, def sort_func(x, y): def cleanup_title(s): + if s is None: + s = _('Unknown') s = s.strip().lower() s = prefix_pat.sub(' ', s) s = trailing_paren_pat.sub('', s)