Skip to content

Commit 6ab22fd

Browse files
committed
fix missing episode title error and blank ep icons
1 parent c8b64b8 commit 6ab22fd

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

zap2epg.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ def printEpisodes(fh):
203203
fh.write('\t\t<title lang=\"' + lang + '\">' + re.sub('&','&amp;',edict['epshow']) + '</title>\n')
204204
if edict['eptitle'] is not None:
205205
fh.write('\t\t<sub-title lang=\"'+ lang + '\">' + re.sub('&','&amp;', edict['eptitle']) + '</sub-title>\n')
206+
else:
207+
fh.write('\t\t<sub-title lang=\"'+ lang + '\">' + '</sub-title>\n')
206208
if xdesc == 'true':
207209
xdescSort = addXDetails(edict)
208210
fh.write('\t\t<desc lang=\"' + lang + '\">' + re.sub('&','&amp;', xdescSort) + '</desc>\n')
@@ -216,15 +218,17 @@ def printEpisodes(fh):
216218
fh.write('\t\t<date>' + edict['epyear'] + '</date>\n')
217219
if not episode.startswith("MV"):
218220
if epicon == '1':
219-
if edict['epimage'] is not None:
221+
if edict['epimage'] is not None and edict['epimage'] != '':
220222
fh.write('\t\t<icon src="https://zap2it.tmsimg.com/assets/' + edict['epimage'] + '.jpg" />\n')
221223
else:
222-
fh.write('\t\t<icon src="https://zap2it.tmsimg.com/assets/' + edict['epthumb'] + '.jpg" />\n')
224+
if edict['epthumb'] is not None and edict['epthumb'] != '':
225+
fh.write('\t\t<icon src="https://zap2it.tmsimg.com/assets/' + edict['epthumb'] + '.jpg" />\n')
223226
if epicon == '2':
224-
if edict['epthumb'] is not None:
227+
if edict['epthumb'] is not None and edict['epthumb'] != '':
225228
fh.write('\t\t<icon src="https://zap2it.tmsimg.com/assets/' + edict['epthumb'] + '.jpg" />\n')
226229
if episode.startswith("MV"):
227-
fh.write('\t\t<icon src="https://zap2it.tmsimg.com/assets/' + edict['epthumb'] + '.jpg" />\n')
230+
if edict['epthumb'] is not None and edict['epthumb'] != '':
231+
fh.write('\t\t<icon src="https://zap2it.tmsimg.com/assets/' + edict['epthumb'] + '.jpg" />\n')
228232
if not any(i in ['New', 'Live'] for i in edict['epflag']):
229233
fh.write("\t\t<previously-shown ")
230234
if edict['epoad'] is not None and int(edict['epoad']) > 0:
@@ -243,15 +247,6 @@ def printEpisodes(fh):
243247
genreNewList = genreSort(edict['epfilter'], edict['epgenres'])
244248
for genre in genreNewList:
245249
fh.write("\t\t<category lang=\"" + lang + "\">" + genre + "</category>\n")
246-
# filterClean = re.sub('filter-','',f).capitalize()
247-
# fh.write("\t\t<category lang=\"" + lang + "\">" + filterClean + "</category>\n")
248-
# if edict['epfilter'] is not None and edict['epfilter'] is not []:
249-
# for f in edict['epfilter']:
250-
# filterClean = re.sub('filter-','',f).capitalize()
251-
# fh.write("\t\t<category lang=\"" + lang + "\">" + filterClean + "</category>\n")
252-
# if edict['epgenres'] is not None and edict['epgenres'] is not []:
253-
# for genre in edict['epgenres']:
254-
# fh.write("\t\t<category lang=\"" + lang + "\">" + genre + "</category>\n")
255250
fh.write("\t</programme>\n")
256251
episodeCount += 1
257252
except Exception as e:

0 commit comments

Comments
 (0)