Store: Don't add duplicate results to results.

This commit is contained in:
John Schember 2011-04-21 21:31:10 -04:00
parent 791e65fd00
commit 8c74aae44a
2 changed files with 15 additions and 11 deletions

View File

@ -463,17 +463,18 @@ class Matches(QAbstractItemModel):
self.reset()
def add_result(self, result, store_plugin):
self.layoutAboutToBeChanged.emit()
self.all_matches.append(result)
self.search_filter.add_search_result(result)
if result.cover_url:
result.cover_queued = True
self.cover_pool.add_task(result, self.filter_results)
else:
result.cover_queued = False
self.details_pool.add_task(result, store_plugin, self.got_result_details)
self.filter_results()
self.layoutChanged.emit()
if result not in self.all_matches:
self.layoutAboutToBeChanged.emit()
self.all_matches.append(result)
self.search_filter.add_search_result(result)
if result.cover_url:
result.cover_queued = True
self.cover_pool.add_task(result, self.filter_results)
else:
result.cover_queued = False
self.details_pool.add_task(result, store_plugin, self.got_result_details)
self.filter_results()
self.layoutChanged.emit()
def get_result(self, index):
row = index.row()

View File

@ -22,3 +22,6 @@ class SearchResult(object):
self.detail_item = ''
self.drm = None
self.formats = ''
def __eq__(self, other):
return self.title == other.title and self.author == other.author and self.store_name == other.store_name