forked from LBRYCommunity/lbry-sdk
prevent duplicate entries in the datastore
This commit is contained in:
parent
23c202b5e4
commit
e5703833cf
1 changed files with 2 additions and 1 deletions
|
@ -40,6 +40,7 @@ class DictDataStore(UserDict.DictMixin):
|
||||||
|
|
||||||
def addPeerToBlob(self, key, value, lastPublished, originallyPublished, originalPublisherID):
|
def addPeerToBlob(self, key, value, lastPublished, originallyPublished, originalPublisherID):
|
||||||
if key in self._dict:
|
if key in self._dict:
|
||||||
|
if value not in map(lambda store_tuple: store_tuple[0], self._dict[key]):
|
||||||
self._dict[key].append((value, lastPublished, originallyPublished, originalPublisherID))
|
self._dict[key].append((value, lastPublished, originallyPublished, originalPublisherID))
|
||||||
else:
|
else:
|
||||||
self._dict[key] = [(value, lastPublished, originallyPublished, originalPublisherID)]
|
self._dict[key] = [(value, lastPublished, originallyPublished, originalPublisherID)]
|
||||||
|
|
Loading…
Add table
Reference in a new issue