2013-10-23, 02:38
I think you're running an old copy...
you should have that already in your code it should look like this:
you should have that already in your code it should look like this:
Code:
now = datetime.datetime.now()
stopDate = self.parseXMLTVDate(elem.get('stop'))
startDate = self.parseXMLTVDate(elem.get('start'))
#skip old shows that have already ended
if now > stopDate:
self.log("buildLiveTVFileList CHANNEL: " + str(self.settingChannel) + " OLD: " + title)
self.log("Unaired = " + str(new) + " tvdbid = " + str(tvdbid) + " imdbid = " + str(imdbid) + " episodeId = " + str(episodeId) + " seasonNumber = " + str(seasonNumber) + " episodeNumber = " + str(episodeNumber) + " category = " + str(category) + " sbManaged =" + str(sbManaged) + " cpManaged =" + str(cpManaged))
continue
#adjust the duration of the current show
if now > startDate and now < stopDate:
try:
#dur = ((stopDate - startDate).seconds)
dur = ((stopDate - startDate).seconds) - ((now - startDate).seconds)
self.log("buildLiveTVFileList CHANNEL: " + str(self.settingChannel) + " NOW PLAYING: " + title + " DUR: " + str(dur))
self.log("Unaired = " + str(new) + " tvdbid = " + str(tvdbid) + " imdbid = " + str(imdbid) + " episodeId = " + str(episodeId) + " seasonNumber = " + str(seasonNumber) + " episodeNumber = " + str(episodeNumber) + " category = " + str(category) + " sbManaged =" + str(sbManaged) + " cpManaged =" + str(cpManaged))
except:
dur = 3600 #60 minute default
self.log("buildLiveTVFileList CHANNEL: " + str(self.settingChannel) + " - Error calculating show duration (defaulted to 60 min)")
raise
#use the full duration for an upcoming show
if now < startDate:
try:
dur = (stopDate - startDate).seconds
self.log("buildLiveTVFileList CHANNEL: " + str(self.settingChannel) + " UPCOMING: " + title + " DUR: " + str(dur))
self.log("Unaired = " + str(new) + " tvdbid = " + str(tvdbid) + " imdbid = " + str(imdbid) + " episodeId = " + str(episodeId) + " seasonNumber = " + str(seasonNumber) + " episodeNumber = " + str(episodeNumber) + " category = " + str(category) + " sbManaged =" + str(sbManaged) + " cpManaged =" + str(cpManaged))
except:
dur = 3600 #60 minute default
self.log("buildLiveTVFileList CHANNEL: " + str(self.settingChannel) + " - Error calculating show duration (defaulted to 60 min)")
raise
if tvdbid > 0:
# tmpstr = str(dur) + ',' + title + "//" + "LiveTV" + "//" + description + "//" + str(tvposterurl) + '\n' + url
tmpstr = str(dur) + ',' + title + "//" + "LiveTV" + "//" + description + "//" + '\n' + url
elif imdbid > 0:
# tmpstr = str(dur) + ',' + title + "//" + "LiveMovie" + "//" + description + "//" + str(moviePosterUrl) + '\n' + url
tmpstr = str(dur) + ',' + title + "//" + "LiveMovie" + "//" + description + "//" + '\n' + url
else:
tmpstr = str(dur) + ',' + title + "//" + "LiveTV" + "//" + description + "//" + '\n' + url
tmpstr = tmpstr.replace("\\n", " ").replace("\\r", " ").replace("\\\"", "\"")
showList.append(tmpstr)
else:
if inSet == True:
self.log("buildLiveTVFileList CHANNEL: " + str(self.settingChannel) + " DONE")
break
showcount += 1
root.clear()