diff --git a/addon.xml b/addon.xml index b47d863..4380688 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/changelog.txt b/changelog.txt index 03341d6..d1a40ae 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,9 @@ -[B]Version 2.0.6 - 2013-xx-xx[/B[ +[B]Version 2.1.0 - 2014-03-24[/B] +- Fixed 'red tint' problem and other minor problems on Gotham + +[B]Version 2.0.6 - unreleased[/B] - Merged ONTV source into XMLTV - It's not possible to loa XMLTV either from a local file or from a URL + It's now possible to load XMLTV either from a local file or from a URL - Display a 'No program available' for channels without programs to be able to stream [B]Version 2.0.5 - 2013-06-04[/B] diff --git a/gui.py b/gui.py index 8086c94..2a45ae4 100644 --- a/gui.py +++ b/gui.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2013 Tommy Winther +# Copyright (C) 2014 Tommy Winther # http://tommy.winther.nu # # This Program is free software; you can redistribute it and/or modify @@ -122,7 +122,6 @@ def __init__(self): super(TVGuide, self).__init__() self.migrateSettings() - self.initialized = False self.notification = None self.redrawingEPG = False self.isClosing = False @@ -178,11 +177,6 @@ def close(self): @buggalo.buggalo_try_except({'method': 'TVGuide.onInit'}) def onInit(self): - if self.initialized: - # onInit(..) is invoked again by XBMC after a video addon exits after being invoked by XBMC.RunPlugin(..) - xbmc.log("[script.tvguide] TVGuide.onInit(..) invoked, but we're already initialized!") - return - self.initialized = True self._hideControl(self.C_MAIN_MOUSE_CONTROLS, self.C_MAIN_OSD) self._showControl(self.C_MAIN_EPG, self.C_MAIN_LOADING) self.setControlLabel(self.C_MAIN_LOADING_TIME_LEFT, strings(BACKGROUND_UPDATE_IN_PROGRESS)) @@ -451,8 +445,11 @@ def onFocus(self, controlId): return self.setControlLabel(self.C_MAIN_TITLE, '[B]%s[/B]' % program.title) - self.setControlLabel(self.C_MAIN_TIME, - '[B]%s - %s[/B]' % (self.formatTime(program.startDate), self.formatTime(program.endDate))) + if program.startDate or program.endDate: + self.setControlLabel(self.C_MAIN_TIME, + '[B]%s - %s[/B]' % (self.formatTime(program.startDate), self.formatTime(program.endDate))) + else: + self.setControlLabel(self.C_MAIN_TIME, '') if program.description: description = program.description else: @@ -581,8 +578,11 @@ def _showOsd(self): if self.osdProgram is not None: self.setControlLabel(self.C_MAIN_OSD_TITLE, '[B]%s[/B]' % self.osdProgram.title) - self.setControlLabel(self.C_MAIN_OSD_TIME, '[B]%s - %s[/B]' % ( - self.formatTime(self.osdProgram.startDate), self.formatTime(self.osdProgram.endDate))) + if self.osdProgram.startDate or self.osdProgram.endDate: + self.setControlLabel(self.C_MAIN_OSD_TIME, '[B]%s - %s[/B]' % ( + self.formatTime(self.osdProgram.startDate), self.formatTime(self.osdProgram.endDate))) + else: + self.setControlLabel(self.C_MAIN_OSD_TIME, '') self.setControlText(self.C_MAIN_OSD_DESCRIPTION, self.osdProgram.description) self.setControlLabel(self.C_MAIN_OSD_CHANNEL_TITLE, self.osdChannel.title) if self.osdProgram.channel.logo is not None: @@ -705,7 +705,8 @@ def onRedrawEPG(self, channelStart, startTime, focusFunction=None): focusTexture='tvguide-program-grey-focus.png' ) - self.controlAndProgramList.append(ControlAndProgram(control, None)) + program = src.Program(channel, strings(NO_PROGRAM_AVAILABLE), None, None, None) + self.controlAndProgramList.append(ControlAndProgram(control, program)) # add program controls if focusFunction is None: @@ -890,12 +891,18 @@ def _showControl(self, *controlIds): control.setVisible(False) def formatTime(self, timestamp): - format = xbmc.getRegion('time').replace(':%S', '').replace('%H%H', '%H') - return timestamp.strftime(format) + if timestamp: + format = xbmc.getRegion('time').replace(':%S', '').replace('%H%H', '%H') + return timestamp.strftime(format) + else: + return '' def formatDate(self, timestamp): - format = xbmc.getRegion('dateshort') - return timestamp.strftime(format) + if timestamp: + format = xbmc.getRegion('dateshort') + return timestamp.strftime(format) + else: + return '' def setControlImage(self, controlId, image): control = self.getControl(controlId) @@ -985,10 +992,14 @@ def onInit(self): programTitleControl.setLabel(self.program.title) - if self.showRemind: - remindControl.setLabel(strings(REMIND_PROGRAM)) + if self.program.startDate: + remindControl.setEnabled(True) + if self.showRemind: + remindControl.setLabel(strings(REMIND_PROGRAM)) + else: + remindControl.setLabel(strings(DONT_REMIND_PROGRAM)) else: - remindControl.setLabel(strings(DONT_REMIND_PROGRAM)) + remindControl.setEnabled(False) @buggalo.buggalo_try_except({'method': 'PopupMenu.onAction'}) def onAction(self, action): diff --git a/resources/skins/Default/720p/script-tvguide-main.xml b/resources/skins/Default/720p/script-tvguide-main.xml index e028601..59cb752 100644 --- a/resources/skins/Default/720p/script-tvguide-main.xml +++ b/resources/skins/Default/720p/script-tvguide-main.xml @@ -10,11 +10,17 @@ workaround for texture not being loaded -10000 + -10000 + 1 + 1 tvguide-program-red.png workaround for texture not being loaded -10000 + -10000 + 1 + 1 tvguide-program-red-focus.png diff --git a/streaming.py b/streaming.py index 250152e..2618ace 100644 --- a/streaming.py +++ b/streaming.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2012 Tommy Winther +# Copyright (C) 2014 Tommy Winther # http://tommy.winther.nu # # This Program is free software; you can redistribute it and/or modify @@ -19,6 +19,7 @@ # import xbmc from xml.etree import ElementTree +from xml.etree.ElementTree import ParseError from xml.parsers.expat import ExpatError import ConfigParser import os @@ -57,6 +58,8 @@ def loadFavourites(self): entries.append((node.get('name'), value)) except ExpatError: pass + except ParseError: + pass return entries