diff --git a/src/calibre/gui2/library.py b/src/calibre/gui2/library.py index 7d964c3a14..1868623787 100644 --- a/src/calibre/gui2/library.py +++ b/src/calibre/gui2/library.py @@ -216,12 +216,9 @@ class BooksModel(QAbstractTableModel): def delete_books(self, indices): - ids = [ self.id(i) for i in indices ] + ids = map(self.id, indices) for id in ids: - row = self.db.index(id) - self.beginRemoveRows(QModelIndex(), row, row) - self.db.delete_book(id) - self.endRemoveRows() + self.db.delete_book(id, notify=False) self.count_changed() self.clear_caches() self.reset() diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index 2686c3a1cc..bf94144571 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -729,7 +729,7 @@ class LibraryDatabase2(LibraryDatabase): if notify: self.notify('metadata', [id]) - def delete_book(self, id): + def delete_book(self, id, notify=True): ''' Removes book from the result cache and the underlying database. ''' @@ -744,7 +744,8 @@ class LibraryDatabase2(LibraryDatabase): self.conn.commit() self.clean() self.data.books_deleted([id]) - self.notify('delete', [id]) + if notify: + self.notify('delete', [id]) def remove_format(self, index, format, index_is_id=False, notify=True): id = index if index_is_id else self.id(index) diff --git a/src/calibre/web/feeds/recipes/recipe_physics_today.py b/src/calibre/web/feeds/recipes/recipe_physics_today.py index a59e1bde34..d2250ca253 100644 --- a/src/calibre/web/feeds/recipes/recipe_physics_today.py +++ b/src/calibre/web/feeds/recipes/recipe_physics_today.py @@ -1,5 +1,6 @@ import re from calibre.web.feeds.news import BasicNewsRecipe +from calibre import strftime class Physicstoday(BasicNewsRecipe): title = u'Physicstoday' @@ -8,6 +9,7 @@ class Physicstoday(BasicNewsRecipe): publisher = 'American Institute of Physics' category = 'Physics' language = _('English') + cover_url = strftime('http://ptonline.aip.org/journals/doc/PHTOAD-home/jrnls/images/medcover%m_%Y.jpg') oldest_article = 30 max_articles_per_feed = 100 no_stylesheets = True @@ -17,8 +19,10 @@ class Physicstoday(BasicNewsRecipe): remove_tags_before = dict(name='h1') remove_tags = [dict(name='div', attrs={'class':'highslide-footer'})] remove_tags = [dict(name='div', attrs={'class':'highslide-header'})] + #remove_tags = [dict(name='a', attrs={'class':'highslide'})] preprocess_regexps = [ - (re.compile(r'.*', re.DOTALL|re.IGNORECASE), + #(re.compile(r'.*', re.DOTALL|re.IGNORECASE), + (re.compile(r'.*', re.DOTALL|re.IGNORECASE), lambda match: ''), ]