Skip to content

Commit c2179bd

Browse files
authored
Update itunes.py
1 parent dc054e6 commit c2179bd

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/feedvalidator/itunes.py

+22
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def do_itunes_new_feed_url(self):
6363
self.log(UndefinedElement({"parent":self.name.replace("_",":"), "element":self.child}))
6464
return rfc2396_full(), noduplicates()
6565

66+
def do_itunes_type(self):
67+
return channeltype(), noduplicates()
68+
6669
class itunes_item(itunes):
6770
supported_formats = ['m4a', 'mp3', 'mov', 'mp4', 'm4v', 'pdf', 'epub']
6871

@@ -92,6 +95,18 @@ def setEnclosure(self, url):
9295
def do_itunes_duration(self):
9396
return duration(), noduplicates()
9497

98+
def do_itunes_title(self):
99+
return text(), noduplicates()
100+
101+
def do_itunes_episode(self):
102+
return positiveInteger(), noduplicates()
103+
104+
def do_itunes_season(self):
105+
return positiveInteger(), noduplicates()
106+
107+
def do_itunes_episodeType(self):
108+
return episodetype(), noduplicates()
109+
95110
class owner(validatorBase):
96111
def validate(self):
97112
if not "itunes_email" in self.children:
@@ -306,3 +321,10 @@ def validate(self):
306321
if not self.value.lower() in ['yes','no','clean']:
307322
self.log(InvalidYesNoClean({"parent":self.parent.name, "element":self.name,"value":self.value}))
308323

324+
class channeltype(enumeration):
325+
error = InvalidItunesChannelType
326+
valuelist = ["episodic", "serial"]
327+
328+
class episodetype(enumeration):
329+
error = InvalidItunesEpisodeType
330+
valuelist = ["full", "trailer", "bonus"]

0 commit comments

Comments
 (0)