@@ -76,19 +76,25 @@ class PodcastAttr(Target):
7676 WANT_TEXT = True
7777
7878 def end (self , handler , text ):
79+ if not self .overwrite and handler .get_podcast_attr (self .key ):
80+ return
7981 handler .set_podcast_attr (self .key , self .filter_func (text ))
8082
8183class PodcastAttrList (Target ):
8284 WANT_TEXT = True
8385
8486 def end (self , handler , text ):
87+ if not self .overwrite and handler .get_podcast_attr (self .key ):
88+ return
8589 handler .set_podcast_attr (self .key , self .filter_func (text ).split (', ' ))
8690
8791
8892class PodcastAttrType (Target ):
8993 WANT_TEXT = True
9094
9195 def end (self , handler , text ):
96+ if not self .overwrite and handler .get_podcast_attr (self .key ):
97+ return
9298 value = self .filter_func (text )
9399 if value in ('episodic' , 'serial' ):
94100 handler .set_podcast_attr (self .key , value )
@@ -104,6 +110,8 @@ class PodcastAttrFromHref(Target):
104110 ATTRIBUTE = 'href'
105111
106112 def start (self , handler , attrs ):
113+ if not self .overwrite and handler .get_podcast_attr (self .key ):
114+ return
107115 value = attrs .get (self .ATTRIBUTE )
108116 if value :
109117 value = urlparse .urljoin (handler .base , value )
@@ -734,6 +742,7 @@ def parse_pubdate(text):
734742 'rss/channel/title' : PodcastAttr ('title' , squash_whitespace ),
735743 'rss/channel/link' : PodcastAttrRelativeLink ('link' ),
736744 'rss/channel/description' : PodcastAttr ('description' , squash_whitespace_not_nl ),
745+ 'rss/channel/itunes:summary' : PodcastAttr ('description' , squash_whitespace_not_nl , overwrite = False ),
737746 'rss/channel/podcast:funding' : PodcastAttrFromUrl ('funding_url' ),
738747 'rss/channel/podcast:locked' : PodcastAttrExplicit ('import_prohibited' ),
739748 'rss/channel/image/url' : PodcastAttrRelativeLink ('cover_url' ),
@@ -845,6 +854,9 @@ def set_base(self, base):
845854 def set_podcast_attr (self , key , value ):
846855 self .data [key ] = value
847856
857+ def get_podcast_attr (self , key , default = None ):
858+ return self .data .get (key , default )
859+
848860 def set_episode_attr (self , key , value ):
849861 self .episodes [- 1 ][key ] = value
850862
0 commit comments