Skip to content
Browse files

Updated PodcastChannel.addItem to avoid adding duplicates of already

known podcasts. 
 --Cette ligne, et les suivantes ci-dessous, seront ignorées--

M    gpodder-core/src/gpodder/libpodcasts.py
M    gpodder-core/ChangeLog


git-svn-id: svn://svn.berlios.de/gpodder/branches/gpodder-core@167 b0d088ad-0a06-0410-aad2-9ed5178a7e87
  • Loading branch information...
1 parent ca2f6cc commit 6ed91a87ed4a222be61be2ae00d84187db66ddfe @informancer informancer committed Sep 28, 2006
Showing with 12 additions and 2 deletions.
  1. +4 −0 ChangeLog
  2. +8 −2 src/gpodder/libpodcasts.py
View
4 ChangeLog
@@ -1,3 +1,7 @@
+Thu, 28 Sep 2006 20:35:48 +0200 <informancer@web.de>
+ * Updated PodcastChannel.addItem to avoid adding duplicates of
+ already known podcasts.
+
Wed, 27 Sep 2006 23:24:52 +0200 <informancer@web.de>
* Removed test for invalid channel. I now handled in the UIs.
* Fixed a bug in Channel.get_filename.
View
10 src/gpodder/libpodcasts.py
@@ -110,8 +110,8 @@ def set_filename(self, value):
fset=set_filename)
def addItem( self, item):
- ## \todo Check for dupes
- self.append( item)
+ if not self.dupe(item):
+ self.append( item)
def get_localdb_channel( self):
ch = None
@@ -351,6 +351,12 @@ def deleteDownloadedItemByUrlAndTitle(self, url, title):
return True
return False
+ def dupe(self, item):
+ for i in self:
+ if i.url == item.url:
+ return True
+ return False
+
class podcastItem(object):
"""holds data for one object in a channel"""
def __init__( self,

0 comments on commit 6ed91a8

Please sign in to comment.
Something went wrong with that request. Please try again.