The branch, eden-pre has been updated
via abcdfd13775e93fc2fd8156e71e79c0f00d625b1 (commit)
via 7cb3afe35bf89a08fc40ef96f788c85c96aafb95 (commit)
from 36b55f75498269bad074541ed5015f9ca86ad272 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=abcdfd13775e93fc2fd8156e71e79c0f00d625b1
commit abcdfd13775e93fc2fd8156e71e79c0f00d625b1
Author: spiff <[email protected]>
Date: Tue Oct 4 09:51:05 2011 +0200
[script.cdartmanager] -v 2.5.1
diff --git a/.gitignore b/.gitignore
index 8ea6aaa..ec88270 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ script.extrafanartdownloader/.git
script.tvguide/.git
script.tvguide/.gitignore
script.tvguide/.idea
+script.cdartmanager/.git
diff --git a/script.cdartmanager/addon.xml b/script.cdartmanager/addon.xml
index 39e16d0..a316ed9 100644
--- a/script.cdartmanager/addon.xml
+++ b/script.cdartmanager/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.cdartmanager"
name="cdART Manager"
- version="2.5.0"
+ version="2.5.1"
provider-name="Giftie">
<requires>
<import addon="xbmc.python" version="2.0"/>
diff --git a/script.cdartmanager/changelog.txt
b/script.cdartmanager/changelog.txt
index 60db84c..fab9dea 100644
--- a/script.cdartmanager/changelog.txt
+++ b/script.cdartmanager/changelog.txt
@@ -1,3 +1,7 @@
+2.5.1
+- fixed error when artist name or album title contains a double quote
+- fixed changes made in XBMC(json-rpc)
+
2.5.0
- clean up excess logging comments, cosmetics
- Changed major version number for Pre-Eden Version
diff --git a/script.cdartmanager/resources/language/Dutch/strings.xml
b/script.cdartmanager/resources/language/Dutch/strings.xml
index 48ca81e..56e8146 100644
--- a/script.cdartmanager/resources/language/Dutch/strings.xml
+++ b/script.cdartmanager/resources/language/Dutch/strings.xml
@@ -117,9 +117,9 @@
<string id="32112"></string>
<string id="32113"></string>
<string id="32114"></string>
- <string id="32115">Melding Geven Gedurende Database Bouwen op de
Achtergrond</string>
- <string id="32116">Melding Geven na Bouwen van Database op de Achtergrond
(weergeven voor 2 seconden)</string>
+ <string id="32115">Melding geven gedurende database obuwen op de
achtergrond</string>
+ <string id="32116">Melding geven na Bouwen van database op de achtergrond
(weergeven voor 2 seconden)</string>
<string id="32117">Database Bouwen Compleet</string>
- <string id="32118">Background Database building in progress... Exiting
Script...</string>
- <string id="32119">Stopping Background Database Building</string>
+ <string id="32118">Bezig met bouwen database op de achtergrond... script
beindingen...</string>
+ <string id="32119">Stoppen met bouwen van database op de achtergrond</string>
</strings>
diff --git a/script.cdartmanager/resources/lib/musicbrainz_utils.py
b/script.cdartmanager/resources/lib/musicbrainz_utils.py
index e89f617..5d9eb73 100644
--- a/script.cdartmanager/resources/lib/musicbrainz_utils.py
+++ b/script.cdartmanager/resources/lib/musicbrainz_utils.py
@@ -27,8 +27,8 @@ def get_musicbrainz_with_singles( album_title, artist,
e_count ):
xbmc.log( "[script.cdartmanager] - Retieving MusicBrainz Info - Including
Singles", xbmc.LOGDEBUG )
xbmc.log( "[script.cdartmanager] - Artist: %s" % repr(artist),
xbmc.LOGDEBUG )
xbmc.log( "[script.cdartmanager] - Album: %s" % repr(album_title),
xbmc.LOGDEBUG )
- #artist = artist.replace(" & "," ")
- #album_title = album_title.replace(" & "," ")
+ artist = artist.replace('"','?')
+ album_title = album_title.replace('"','?')
try:
q = """'"%s" AND artist:"%s"'""" % (album_title, artist)
filter = ReleaseGroupFilter( query=q, limit=1)
@@ -52,14 +52,20 @@ def get_musicbrainz_with_singles( album_title, artist,
e_count ):
except WebServiceError, e:
xbmc.log( "[script.cdartmanager] - Error: %s" % e, xbmc.LOGERROR )
web_error = "%s" % e
- if int( web_error.replace( "HTTP Error ", "").replace( ":", "") ) ==
503 and count < 5:
- xbmc.sleep( 2000 ) # give the musicbrainz server a 2 second break
hopefully it will recover
- count += 1
- album = album = get_musicbrainz_with_singles( album_title, artist,
count ) # try again
- elif int( web_error.replace( "HTTP Error ", "").replace( ":", "") ) ==
503 and count > 5:
- xbmc.log( "[script.cdartmanager] - Script being blocked, attempted
5 tries with 2 second pauses", xbmc.LOGDEBUG )
- count = 0
- else:
+ try:
+ if int( web_error.replace( "HTTP Error ", "").replace( ":", "") )
== 503 and count < 5:
+ xbmc.sleep( 2000 ) # give the musicbrainz server a 2 second
break hopefully it will recover
+ count += 1
+ album = album = get_musicbrainz_with_singles( album_title,
artist, count ) # try again
+ elif int( web_error.replace( "HTTP Error ", "").replace( ":", "")
) == 503 and count > 5:
+ xbmc.log( "[script.cdartmanager] - Script being blocked,
attempted 5 tries with 2 second pauses", xbmc.LOGDEBUG )
+ count = 0
+ else:
+ album["artist"] = ""
+ album["artist_id"] = ""
+ album["id"] = ""
+ album["title"] = ""
+ except:
album["artist"] = ""
album["artist_id"] = ""
album["id"] = ""
@@ -74,8 +80,8 @@ def get_musicbrainz_album( album_title, artist, e_count ):
xbmc.log( "[script.cdartmanager] - Retieving MusicBrainz Info - Not
including Singles", xbmc.LOGDEBUG )
xbmc.log( "[script.cdartmanager] - Artist: %s" % repr(artist),
xbmc.LOGDEBUG )
xbmc.log( "[script.cdartmanager] - Album: %s" % repr(album_title),
xbmc.LOGDEBUG )
- #artist = artist.replace(" & "," ")
- #album_title = album_title.replace(" & "," ")
+ artist = artist.replace('"','?')
+ album_title = album_title.replace('"','?')
try:
q = """'"%s" AND artist:"%s" NOT type:"Single"'""" % (album_title,
artist)
filter = ReleaseGroupFilter( query=q, limit=1)
@@ -97,16 +103,22 @@ def get_musicbrainz_album( album_title, artist, e_count ):
except WebServiceError, e:
xbmc.log( "[script.cdartmanager] - Error: %s" % e, xbmc.LOGERROR )
web_error = "%s" % e
- if int( web_error.replace( "HTTP Error ", "").replace( ":", "") ) ==
503 and count < 5:
- xbmc.sleep( 2000 ) # give the musicbrainz server a 2 second break
hopefully it will recover
- count += 1
- album = get_musicbrainz_album( album_title, artist, count ) # try
again
- elif int( web_error.replace( "HTTP Error ", "").replace( ":", "") ) ==
503 and count > 5:
- xbmc.log( "[script.cdartmanager] - Script being blocked, attempted
5 tries with 2 second pauses", xbmc.LOGDEBUG )
- count = 0
- else:
- xbmc.sleep( 1000 ) # sleep for allowing proper use of webserver
- album = get_musicbrainz_with_singles( album_title, artist, 0 )
+ try:
+ if int( web_error.replace( "HTTP Error ", "").replace( ":", "") )
== 503 and count < 5:
+ xbmc.sleep( 2000 ) # give the musicbrainz server a 2 second
break hopefully it will recover
+ count += 1
+ album = get_musicbrainz_album( album_title, artist, count ) #
try again
+ elif int( web_error.replace( "HTTP Error ", "").replace( ":", "")
) == 503 and count > 5:
+ xbmc.log( "[script.cdartmanager] - Script being blocked,
attempted 5 tries with 2 second pauses", xbmc.LOGDEBUG )
+ count = 0
+ else:
+ xbmc.sleep( 1000 ) # sleep for allowing proper use of webserver
+ album = get_musicbrainz_with_singles( album_title, artist, 0 )
+ except:
+ album["artist"] = ""
+ album["artist_id"] = ""
+ album["id"] = ""
+ album["title"] = ""
count = 0
xbmc.sleep( 1000 ) # sleep for allowing proper use of webserver
return album
diff --git a/script.cdartmanager/resources/lib/pre_eden_code.py
b/script.cdartmanager/resources/lib/pre_eden_code.py
index 4acc541..2d0872d 100644
--- a/script.cdartmanager/resources/lib/pre_eden_code.py
+++ b/script.cdartmanager/resources/lib/pre_eden_code.py
@@ -14,14 +14,14 @@ def get_all_local_artists():
def retrieve_album_list():
xbmc.log( "[script.cdartmanager] - pre_eden_code - Retrieving Album List"
, xbmc.LOGDEBUG )
- json_query = '{"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbums",
"params": {"fields": ["title", "artist"] }, "id": 1}'
+ json_query = '{"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbums",
"params": { "limits": { "start": 0 }, "properties": ["title", "artist"],
"sort": {"order":"ascending"}}, "id": 1}'
json_albums = retrieve_json_dict(json_query, items='albums',
force_log=False )
return json_albums, len(json_albums)
def retrieve_album_details( album_id ):
xbmc.log( "[script.cdartmanager] - pre_eden_code - Retrieving Album Path",
xbmc.LOGDEBUG )
album_details = []
- json_query = '{"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbumDetails",
"params": {"fields": ["artist", "title"], "albumid": %d}, "id": 1}' % album_id
+ json_query = '{"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbumDetails",
"params": {"properties": ["artist", "title"], "albumid": %d}, "id": 1}' %
album_id
json_album_details = retrieve_json_dict(json_query, items='albumdetails',
force_log=False )
if json_album_details:
album_details.append( json_album_details )
@@ -30,7 +30,7 @@ def retrieve_album_details( album_id ):
def get_album_path( album_id ):
xbmc.log( "[script.cdartmanager] - pre_eden_code - Retrieving Album Path",
xbmc.LOGDEBUG )
paths = []
- json_query = '{"jsonrpc": "2.0", "method": "AudioLibrary.GetSongs",
"params": {"albumid": %d, "fields": ["file"], "fields": ["file"], "sort":
{"method":"fullpath","order":"ascending"}}, "id": 1}' % album_id
+ json_query = '{"jsonrpc": "2.0", "method": "AudioLibrary.GetSongs",
"params": {"albumid": %d, "properties": ["file"], "sort":
{"method":"fullpath","order":"ascending"}}, "id": 1}' % album_id
json_songs_detail = retrieve_json_dict(json_query, items='songs',
force_log=False )
if json_songs_detail:
for song in json_songs_detail:
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/scripts;a=commit;h=7cb3afe35bf89a08fc40ef96f788c85c96aafb95
commit 7cb3afe35bf89a08fc40ef96f788c85c96aafb95
Author: spiff <[email protected]>
Date: Tue Oct 4 09:49:47 2011 +0200
[script.tvguide] -v 1.1.0
diff --git a/.gitignore b/.gitignore
index 64bd1fd..8ea6aaa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
script.pseudotv/.git
script.module.xbmcswift/.git
script.extrafanartdownloader/.git
+script.tvguide/.git
+script.tvguide/.gitignore
+script.tvguide/.idea
diff --git a/script.tvguide/addon.py b/script.tvguide/addon.py
index ede2d64..d6b6e58 100644
--- a/script.tvguide/addon.py
+++ b/script.tvguide/addon.py
@@ -3,6 +3,7 @@ import xbmcaddon
import source
import gui
+import notification
SOURCES = {
'YouSee.tv' : source.YouSeeTvSource,
@@ -17,14 +18,18 @@ sourceRef = SOURCES[ADDON.getSetting('source')]
SETTINGS = {
'cache.path' : xbmc.translatePath(ADDON.getAddonInfo('profile')),
'xmltv.file' : ADDON.getSetting('xmltv.file'),
- 'youseetv.category' : ADDON.getSetting('youseetv.category')
+ 'youseetv.category' : ADDON.getSetting('youseetv.category'),
+ 'notifications.enabled' : ADDON.getSetting('notifications.enabled'),
+ 'cache.data.on.xbmc.startup' :
ADDON.getSetting('cache.data.on.xbmc.startup')
}
SOURCE = sourceRef(SETTINGS)
-xbmc.log("Loading TVGuide [script.tvguide] source: " + str(sourceRef))
+n = notification.Notification(SOURCE, ADDON.getAddonInfo('path'),
xbmc.translatePath(ADDON.getAddonInfo('profile')))
+
+xbmc.log("[script.tvguide] Using source: " + str(sourceRef))
if __name__ == '__main__':
- w = gui.TVGuide(source = SOURCE)
+ w = gui.TVGuide(source = SOURCE, notification = n)
w.doModal()
del w
diff --git a/script.tvguide/addon.xml b/script.tvguide/addon.xml
index 8a6972a..0a954f5 100644
--- a/script.tvguide/addon.xml
+++ b/script.tvguide/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.tvguide"
name="TV Guide"
- version="1.0.1"
+ version="1.1.0"
provider-name="twinther [[email protected]]">
<requires>
<import addon="xbmc.python" version="2.0"/>
diff --git a/script.tvguide/changelog.txt b/script.tvguide/changelog.txt
index f17d501..f4a5611 100644
--- a/script.tvguide/changelog.txt
+++ b/script.tvguide/changelog.txt
@@ -1,3 +1,8 @@
+[B]Version 1.1.0 - 2011-10-03[/B]
+- Add option to get notified before programs start
+- New graphics
+- Readded initial support for streaming channels
+
[B]Version 1.0.1 - 2011-09-10[/B]
- Made paging of channels more logical to navigate
- Better handling of errors if EPG data is unavailable
diff --git a/script.tvguide/clear_cache.py b/script.tvguide/clear_cache.py
index a78d4a4..3bfc62c 100644
--- a/script.tvguide/clear_cache.py
+++ b/script.tvguide/clear_cache.py
@@ -5,14 +5,13 @@ import xbmcgui
from strings import *
-
xbmc.log("Clearing TVGuide [script.tvguide] caches...")
cachePath = xbmc.translatePath(xbmcaddon.Addon(id =
'script.tvguide').getAddonInfo('profile'))
for file in os.listdir(cachePath):
- if file != 'settings.xml':
+ if file not in ['settings.xml', 'notification.db']:
os.unlink(os.path.join(cachePath, file))
-xbmcgui.Dialog().ok(strings(CLEAR_CACHE), strings(CLEAR_CACHE_DONE))
+xbmcgui.Dialog().ok(strings(CLEAR_CACHE), strings(DONE))
xbmc.log("Clearing TVGuide [script.tvguide] caches. Done!")
\ No newline at end of file
diff --git a/script.tvguide/gui.py b/script.tvguide/gui.py
index 6f09607..b26a7cb 100644
--- a/script.tvguide/gui.py
+++ b/script.tvguide/gui.py
@@ -19,7 +19,7 @@ KEY_INFO = 11
KEY_NAV_BACK = 92
KEY_CONTEXT_MENU = 117
-CHANNELS_PER_PAGE = 8
+CHANNELS_PER_PAGE = 9
CELL_HEIGHT = 50
CELL_WIDTH = 275
@@ -28,8 +28,10 @@ CELL_WIDTH_CHANNELS = 180
HALF_HOUR = datetime.timedelta(minutes = 30)
ADDON = xbmcaddon.Addon(id = 'script.tvguide')
-TEXTURE_BUTTON_NOFOCUS =
os.path.join(xbmc.translatePath(ADDON.getAddonInfo('path')), 'resources',
'skins', 'Default', 'media', 'cell-bg.png')
-TEXTURE_BUTTON_FOCUS =
os.path.join(xbmc.translatePath(ADDON.getAddonInfo('path')), 'resources',
'skins', 'Default', 'media', 'cell-bg-selected.png')
+TEXTURE_BUTTON_NOFOCUS =
os.path.join(xbmc.translatePath(ADDON.getAddonInfo('path')), 'resources',
'skins', 'Default', 'media', 'tvguide-program-grey.png')
+TEXTURE_BUTTON_FOCUS =
os.path.join(xbmc.translatePath(ADDON.getAddonInfo('path')), 'resources',
'skins', 'Default', 'media', 'tvguide-program-grey-focus.png')
+TEXTURE_BUTTON_NOFOCUS_NOTIFY =
os.path.join(xbmc.translatePath(ADDON.getAddonInfo('path')), 'resources',
'skins', 'Default', 'media', 'tvguide-program-red.png')
+TEXTURE_BUTTON_FOCUS_NOTIFY =
os.path.join(xbmc.translatePath(ADDON.getAddonInfo('path')), 'resources',
'skins', 'Default', 'media', 'tvguide-program-red-focus.png')
class TVGuide(xbmcgui.WindowXML):
C_MAIN_TITLE = 4020
@@ -38,14 +40,20 @@ class TVGuide(xbmcgui.WindowXML):
C_MAIN_IMAGE = 4023
C_MAIN_LOADING = 4200
C_MAIN_LOADING_PROGRESS = 4201
+ C_MAIN_BACKGROUND = 4600
- def __new__(cls, source):
+ def __new__(cls, source, notification):
return super(TVGuide, cls).__new__(cls, 'script-tvguide-main.xml',
ADDON.getAddonInfo('path'))
- def __init__(self, source):
+ def __init__(self, source, notification):
+ """
+ @param source: the source of EPG data
+ @type source: source.Source
+ @type notification: notification.Notification
+ """
super(TVGuide, self).__init__()
-
self.source = source
+ self.notification = notification
self.controlToProgramMap = {}
self.focusX = 0
self.page = 0
@@ -93,10 +101,28 @@ class TVGuide(xbmcgui.WindowXML):
def onClick(self, controlId):
program = self.controlToProgramMap[controlId]
- if program.imageLarge is not None:
- d = TVGuideInfo(program)
- d.doModal()
- del d
+ isNotificationRequiredForProgram =
self.notification.isNotificationRequiredForProgram(program)
+
+ d = PopupMenu(program, not isNotificationRequiredForProgram)
+ d.doModal()
+ buttonClicked = d.buttonClicked
+ del d
+
+ if buttonClicked == PopupMenu.C_POPUP_REMIND:
+ if isNotificationRequiredForProgram:
+ self.notification.delProgram(program)
+ else:
+ self.notification.addProgram(program)
+
+ control = self.getControl(controlId)
+ (left, top) = control.getPosition()
+ y = top + (control.getHeight() / 2)
+ self.onRedrawEPG(self.page, self.date, autoChangeFocus = False)
+ self.setFocus(self._findControlOnRight(left, y))
+
+ elif buttonClicked == PopupMenu.C_POPUP_PLAY:
+ program.channel.play()
+
def onFocus(self, controlId):
controlInFocus = self.getControl(controlId)
@@ -104,7 +130,6 @@ class TVGuide(xbmcgui.WindowXML):
if left > self.focusX or left + controlInFocus.getWidth() <
self.focusX:
self.focusX = left
-
program = self.controlToProgramMap[controlId]
self.getControl(self.C_MAIN_TITLE).setLabel('[B]%s[/B]' %
program.title)
@@ -114,6 +139,9 @@ class TVGuide(xbmcgui.WindowXML):
if program.imageSmall is not None:
self.getControl(self.C_MAIN_IMAGE).setImage(program.imageSmall)
+ if ADDON.getSetting('program.background.enabled') == 'true' and
program.imageLarge is not None:
+
self.getControl(self.C_MAIN_BACKGROUND).setImage(program.imageLarge)
+
def _left(self, currentX, currentY):
control = self._findControlOnLeft(currentX, currentY)
if control is None:
@@ -158,7 +186,7 @@ class TVGuide(xbmcgui.WindowXML):
self.page = self.onRedrawEPG(self.page+ 1, self.date)
return self._findControlBelow(0)
- def onRedrawEPG(self, page, startTime):
+ def onRedrawEPG(self, page, startTime, autoChangeFocus = True):
oldControltoProgramMap = self.controlToProgramMap.copy()
self.controlToProgramMap.clear()
@@ -221,15 +249,23 @@ class TVGuide(xbmcgui.WindowXML):
cellWidth = 1260 - cellStart
if cellWidth > 1:
+ if
self.notification.isNotificationRequiredForProgram(program):
+ noFocusTexture = TEXTURE_BUTTON_NOFOCUS_NOTIFY
+ focusTexture = TEXTURE_BUTTON_FOCUS_NOTIFY
+ else:
+ noFocusTexture = TEXTURE_BUTTON_NOFOCUS
+ focusTexture = TEXTURE_BUTTON_FOCUS
+
control = xbmcgui.ControlButton(
cellStart,
- 25 + CELL_HEIGHT * (1 + idx),
- cellWidth,
- CELL_HEIGHT,
+ 60 + CELL_HEIGHT * idx,
+ cellWidth - 2,
+ CELL_HEIGHT - 2,
program.title,
- noFocusTexture = TEXTURE_BUTTON_NOFOCUS,
- focusTexture = TEXTURE_BUTTON_FOCUS
+ noFocusTexture = noFocusTexture,
+ focusTexture = focusTexture
)
+
controlsToAdd.append([control, program])
@@ -244,7 +280,7 @@ class TVGuide(xbmcgui.WindowXML):
try:
self.getFocus()
except TypeError:
- if len(self.controlToProgramMap.keys()) > 0:
+ if len(self.controlToProgramMap.keys()) > 0 and autoChangeFocus:
self.setFocus(self.getControl(self.controlToProgramMap.keys()[0]))
self.getControl(self.C_MAIN_LOADING).setVisible(False)
@@ -343,24 +379,41 @@ class TVGuide(xbmcgui.WindowXML):
-class TVGuideInfo(xbmcgui.WindowXMLDialog):
- C_INFO_IMAGE = 4000
+class PopupMenu(xbmcgui.WindowXMLDialog):
+ C_POPUP_PLAY = 4000
+ C_POPUP_REMIND = 4001
- def __new__(cls, program):
- return super(TVGuideInfo, cls).__new__(cls, 'script-tvguide-info.xml',
ADDON.getAddonInfo('path'))
+ def __new__(cls, program, showRemind):
+ return super(PopupMenu, cls).__new__(cls, 'script-tvguide-menu.xml',
ADDON.getAddonInfo('path'))
- def __init__(self, program):
- super(TVGuideInfo, self).__init__()
+ def __init__(self, program, showRemind):
+ super(PopupMenu, self).__init__()
self.program = program
-
+ self.showRemind = showRemind
+ self.buttonClicked = None
+
def onInit(self):
- self.getControl(self.C_INFO_IMAGE).setImage(self.program.imageLarge)
+ playControl = self.getControl(self.C_POPUP_PLAY)
+ remindControl = self.getControl(self.C_POPUP_REMIND)
+
+ playControl.setLabel(strings(WATCH_CHANNEL,
self.program.channel.title))
+ if not self.program.channel.isPlayable():
+ playControl.setEnabled(False)
+ self.setFocus(remindControl)
+
+ if self.showRemind:
+ remindControl.setLabel(strings(REMIND_PROGRAM))
+ else:
+ remindControl.setLabel(strings(DONT_REMIND_PROGRAM))
def onAction(self, action):
- self.close()
+ if action.getId() in [KEY_BACK, KEY_MENU, KEY_NAV_BACK]:
+ self.close()
+ return
def onClick(self, controlId):
- pass
+ self.buttonClicked = controlId
+ self.close()
def onFocus(self, controlId):
pass
diff --git a/script.tvguide/resources/language/Danish/strings.xml
b/script.tvguide/resources/language/Danish/strings.xml
index e736c45..af8f5b0 100644
--- a/script.tvguide/resources/language/Danish/strings.xml
+++ b/script.tvguide/resources/language/Danish/strings.xml
@@ -9,9 +9,22 @@
<string id="30103">XMLTV fil</string>
<string id="30104">Slet midlertidige filer...</string>
<string id="30105">Færdig!</string>
+ <string id="30106">Vis notifikation før udvalgte programmer
starter</string>
+ <string id="30107">Brug program billede som baggrund</string>
+ <string id="30108">Slet alle påmindelser...</string>
+ <string id="30109">Husk at slette midlertidige filer, når du skifter
kilde</string>
+ <string id="30110">Opdater program information når XBMC starter</string>
+
+ <string id="30150">Ups, det er pinligt!</string>
+ <string id="30151">Det var ikke muligt at indlæse program data,</string>
+ <string id="30152">prøv igen senere...</string>
+
+ <string id="30200">på [B]%s[/B] om 5 minutter...</string>
+
+ <string id="30300">Se %s</string>
+ <string id="30301">PÃ¥mind</string>
+ <string id="30302">PÃ¥mind ikke</string>
+ <string id="30303">Annuller</string>
- <string id="30110">Ups, det er pinligt!</string>
- <string id="30111">Det var ikke muligt at indlæse program data,</string>
- <string id="30112">prøv igen senere...</string>
</strings>
diff --git a/script.tvguide/resources/language/English/strings.xml
b/script.tvguide/resources/language/English/strings.xml
index 6529561..c79af7e 100644
--- a/script.tvguide/resources/language/English/strings.xml
+++ b/script.tvguide/resources/language/English/strings.xml
@@ -9,10 +9,21 @@
<string id="30103">XMLTV file</string>
<string id="30104">Clear cache...</string>
<string id="30105">Done!</string>
+ <string id="30106">Show notification before selected programs
start</string>
+ <string id="30107">Use program image as background</string>
+ <string id="30108">Clear all reminders...</string>
+ <string id="30109">Remember to clear the cache when you change
source</string>
+ <string id="30110">Update program information on XBMC startup</string>
- <string id="30110">Oops, sorry about that!</string>
- <string id="30111">It was not possible to load program data,</string>
- <string id="30112">please try again later...</string>
+ <string id="30150">Oops, sorry about that!</string>
+ <string id="30151">It was not possible to load program data,</string>
+ <string id="30152">please try again later...</string>
+ <string id="30200">on [B]%s[/B] in 5 minutes...</string>
+
+ <string id="30300">Watch %s</string>
+ <string id="30301">Remind</string>
+ <string id="30302">Don't remind</string>
+ <string id="30303">Cancel</string>
</strings>
diff --git a/script.tvguide/resources/settings.xml
b/script.tvguide/resources/settings.xml
index fac253e..b386a89 100644
--- a/script.tvguide/resources/settings.xml
+++ b/script.tvguide/resources/settings.xml
@@ -10,8 +10,17 @@
<setting id="xmltv.file" label="30103" type="file" visible="eq(-2,3)"
/>
+ <setting type="lsep" label="30109" />
+
+ <setting type="sep" />
+ <setting id="notifications.enabled" label="30106" type="bool"
default="true" />
+ <setting id="cache.data.on.xbmc.startup" label="30110" type="bool"
default="true" />
+ <setting id="program.background.enabled" label="30107" type="bool"
default="true" />
+
<setting type="sep" />
<setting label="30104" type="action"
action="RunScript($CWD/clear_cache.py)" />
+ <setting label="30108" type="action"
action="RunScript($CWD/notification.py)" />
+
</category>
</settings>
diff --git
a/script.tvguide/resources/skins/Default/720p/script-tvguide-main.xml
b/script.tvguide/resources/skins/Default/720p/script-tvguide-main.xml
index 4fb6b26..ce9948d 100644
--- a/script.tvguide/resources/skins/Default/720p/script-tvguide-main.xml
+++ b/script.tvguide/resources/skins/Default/720p/script-tvguide-main.xml
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<window>
<allowoverlay>no</allowoverlay>
- <defaultcontrol always="false">1</defaultcontrol>
<coordinates>
<system>1</system>
<posx>0</posx>
@@ -9,13 +8,21 @@
</coordinates>
<controls>
<!-- Background -->
- <control type="image">
+ <control type="image" id="4600">
<posx>0</posx>
<posy>0</posy>
<width>1280</width>
<height>720</height>
- <texture>tvguide-background.png</texture>
+ <texture>tvguide-background-default.jpg</texture>
+ <fadetime>500</fadetime>
</control>
+ <control type="image">
+ <posx>0</posx>
+ <posy>0</posy>
+ <width>1280</width>
+ <height>720</height>
+ <texture>tvguide-background.png</texture>
+ </control>
<control type="group">
<description>TV Guide group</description>
@@ -25,62 +32,70 @@
<height>720</height>
<!-- Date and time row -->
- <control type="label" id="4000">
- <description>Displays todays date</description>
+ <control type="group">
<posx>0</posx>
- <posy>25</posy>
- <width>180</width>
- <height>50</height>
- <textcolor>ffffffff</textcolor>
- <font>font13</font>
- <align>center</align>
- <aligny>center</aligny>
- </control>
- <control type="label" id="4001">
- <description>1st half hour column</description>
- <posx>180</posx>
- <posy>25</posy>
- <width>270</width>
- <height>50</height>
- <textcolor>ffffffff</textcolor>
- <font>font13</font>
- <aligny>center</aligny>
- </control>
- <control type="label" id="4002">
- <description>2nd half hour column</description>
- <posx>455</posx>
- <posy>25</posy>
- <width>270</width>
+ <posy>10</posy>
+ <width>1280</width>
<height>50</height>
- <textcolor>ffffffff</textcolor>
- <font>font13</font>
- <aligny>center</aligny>
- </control>
- <control type="label" id="4003">
- <description>3rd half hour column</description>
- <posx>730</posx>
- <posy>25</posy>
- <width>270</width>
- <height>50</height>
- <textcolor>ffffffff</textcolor>
- <font>font13</font>
- <aligny>center</aligny>
- </control>
- <control type="label" id="4004">
- <description>4th half hour column</description>
- <posx>1005</posx>
- <posy>25</posy>
- <width>270</width>
- <height>50</height>
- <textcolor>ffffffff</textcolor>
- <font>font13</font>
- <aligny>center</aligny>
+ <visible>true</visible>
+
+ <control type="label" id="4000">
+ <description>Displays todays date</description>
+ <posx>0</posx>
+ <posy>0</posy>
+ <width>180</width>
+ <height>50</height>
+ <textcolor>ffffffff</textcolor>
+ <font>font13</font>
+ <align>center</align>
+ <aligny>center</aligny>
+ </control>
+ <control type="label" id="4001">
+ <description>1st half hour column</description>
+ <posx>180</posx>
+ <posy>0</posy>
+ <width>270</width>
+ <height>50</height>
+ <textcolor>ffffffff</textcolor>
+ <font>font13</font>
+ <aligny>center</aligny>
+ </control>
+ <control type="label" id="4002">
+ <description>2nd half hour column</description>
+ <posx>455</posx>
+ <posy>0</posy>
+ <width>270</width>
+ <height>50</height>
+ <textcolor>ffffffff</textcolor>
+ <font>font13</font>
+ <aligny>center</aligny>
+ </control>
+ <control type="label" id="4003">
+ <description>3rd half hour column</description>
+ <posx>730</posx>
+ <posy>0</posy>
+ <width>270</width>
+ <height>50</height>
+ <textcolor>ffffffff</textcolor>
+ <font>font13</font>
+ <aligny>center</aligny>
+ </control>
+ <control type="label" id="4004">
+ <description>4th half hour column</description>
+ <posx>1005</posx>
+ <posy>0</posy>
+ <width>270</width>
+ <height>50</height>
+ <textcolor>ffffffff</textcolor>
+ <font>font13</font>
+ <aligny>center</aligny>
+ </control>
</control>
<!-- Channels text column -->
<control type="group" id="4500">
<posx>0</posx>
- <posy>75</posy>
+ <posy>60</posy>
<width>180</width>
<height>400</height>
<visible>true</visible>
@@ -165,12 +180,22 @@
<font>font13</font>
<align>center</align>
</control>
+ <control type="label" id="4018">
+ <description>9th channel</description>
+ <posx>0</posx>
+ <posy>400</posy>
+ <width>180</width>
+ <height>50</height>
+ <textcolor>ffffffff</textcolor>
+ <font>font13</font>
+ <align>center</align>
+ </control>
</control><!-- end group -->
<!-- Channels icon column -->
<control type="group" id="4501">
<posx>0</posx>
- <posy>75</posy>
+ <posy>60</posy>
<width>180</width>
<height>400</height>
<visible>true</visible>
@@ -247,9 +272,26 @@
<aspectratio>keep</aspectratio>
<fadetime>500</fadetime>
</control>
+ <control type="image" id="4118">
+ <description>9th channel</description>
+ <posx>10</posx>
+ <posy>400</posy>
+ <width>160</width>
+ <height>45</height>
+ <aspectratio>keep</aspectratio>
+ <fadetime>500</fadetime>
+ </control>
</control><!-- end group -->
<!-- Program description -->
+ <!--<control type="image" id="4117">-->
+ <!--<description>glasspane</description>-->
+ <!--<posx>0</posx>-->
+ <!--<posy>500</posy>-->
+ <!--<width>1280</width>-->
+ <!--<height>220</height>-->
+ <!--<texture>tvguide-glasspane.png</texture>-->
+ <!--</control>-->
<control type="label" id="4020">
<description>Program title</description>
<posx>30</posx>
@@ -292,15 +334,15 @@
<width>320</width>
<height>160</height>
<aspectratio>keep</aspectratio>
- <fadetime>250</fadetime>
+ <fadetime>500</fadetime>
<visible>!Control.IsVisible(4200)</visible>
</control>
<control type="image" id="4100">
<posx>180</posx>
- <posy>25</posy>
+ <posy>0</posy>
<width>2</width>
- <height>488</height>
+ <height>515</height>
<texture>timebar.png</texture>
</control>
diff --git
a/script.tvguide/resources/skins/Default/media/tvguide-background.png
b/script.tvguide/resources/skins/Default/media/tvguide-background.png
index a70edec..71e373b 100644
Binary files
a/script.tvguide/resources/skins/Default/media/tvguide-background.png and
b/script.tvguide/resources/skins/Default/media/tvguide-background.png differ
diff --git a/script.tvguide/service.py b/script.tvguide/service.py
index b68750e..e50f47f 100644
--- a/script.tvguide/service.py
+++ b/script.tvguide/service.py
@@ -1,13 +1,11 @@
import addon
+import notification
import xbmc
-xbmc.log("Updating TVGuide [script.tvguide] channel list caches...")
-channelList = addon.SOURCE.getChannelList()
-
-for channel in channelList:
- xbmc.log("Updating TVGuide [script.tvguide] program list caches for
channel " + channel.title + "...")
- addon.SOURCE.getProgramList(channel)
-
-xbmc.log("Done updating TVGuide [script.tvguide] caches.")
-
+if addon.SETTINGS['cache.data.on.xbmc.startup'] == 'true':
+ addon.SOURCE.updateChannelAndProgramListCaches()
+if addon.SETTINGS['notifications.enabled'] == 'true':
+ n = notification.Notification(addon.SOURCE,
addon.ADDON.getAddonInfo('path'),
+ xbmc.translatePath(addon.ADDON.getAddonInfo('profile')))
+ n.scheduleNotifications()
\ No newline at end of file
diff --git a/script.tvguide/source.py b/script.tvguide/source.py
index 0b77cc7..9ad4293 100644
--- a/script.tvguide/source.py
+++ b/script.tvguide/source.py
@@ -7,17 +7,37 @@ from elementtree import ElementTree
from strings import *
import ysapi
+import xbmc
+import xbmcgui
import pickle
+STREAM_DR1 = 'rtmp://rtmplive.dr.dk/live/livedr01astream3'
+STREAM_DR2 = 'rtmp://rtmplive.dr.dk/live/livedr02astream3'
+STREAM_DR_UPDATE = 'rtmp://rtmplive.dr.dk/live/livedr03astream3'
+STREAM_DR_K = 'rtmp://rtmplive.dr.dk/live/livedr04astream3'
+STREAM_DR_RAMASJANG = 'rtmp://rtmplive.dr.dk/live/livedr05astream3'
+STREAM_DR_HD = 'rtmp://livetv.gss.dr.dk/live/livedr06astream3'
+STREAM_24_NORDJYSKE = 'mms://stream.nordjyske.dk/24nordjyske - Full Broadcast
Quality'
+
class Channel(object):
- def __init__(self, id, title, logo = None):
+ def __init__(self, id, title, logo = None, streamUrl = None):
self.id = id
self.title = title
self.logo = logo
+ self.streamUrl = streamUrl
+
+ def isPlayable(self):
+ return hasattr(self, 'streamUrl') and self.streamUrl
+
+ def play(self):
+ print "Playing %s" % self.streamUrl
+# item = xbmcgui.ListItem(path = self.streamUrl)
+# item.setProperty('IsLive', 'true')
+ xbmc.Player().play(item = self.streamUrl + ' live=1')
def __repr__(self):
- return 'Channel(id=%s, title=%s, logo=%s)' \
- % (self.id, self.title, self.logo)
+ return 'Channel(id=%s, title=%s, logo=%s, streamUrl=%s)' \
+ % (self.id, self.title, self.logo, self.streamUrl)
class Program(object):
def __init__(self, channel, title, startDate, endDate, description,
imageLarge = None, imageSmall=None):
@@ -36,7 +56,8 @@ class Program(object):
class Source(object):
KEY = "undefiend"
-
+ STREAMS = {}
+
def __init__(self, settings, hasChannelIcons):
self.channelIcons = hasChannelIcons
self.cachePath = settings['cache.path']
@@ -44,6 +65,16 @@ class Source(object):
def hasChannelIcons(self):
return self.channelIcons
+ def updateChannelAndProgramListCaches(self):
+ print "[script.tvguide] Updating channel list caches..."
+ channelList = self.getChannelList()
+
+ for channel in channelList:
+ print "[script.tvguide] Updating program list caches for channel "
+ channel.title.decode('iso-8859-1') + "..."
+ self.getProgramList(channel)
+
+ print "[script.tvguide] Done updating caches."
+
def getChannelList(self):
cacheFile = os.path.join(self.cachePath, self.KEY + '.channellist')
@@ -57,14 +88,18 @@ class Source(object):
if not cacheHit:
try:
channelList = self._getChannelList()
+ for channel in channelList:
+ if self.STREAMS.has_key(channel.id):
+ channel.streamUrl = self.STREAMS[channel.id]
+
pickle.dump(channelList, open(cacheFile, 'w'))
except Exception, ex:
- print "Unable to get channel list\n" + str(ex)
+ print "[script.tvguide] Unable to get channel list\n" + str(ex)
else:
- channelList = pickle.load(open(cacheFile))
-
- if channelList:
- print "Loaded %d channels" % len(channelList)
+ try:
+ channelList = pickle.load(open(cacheFile))
+ except Exception:
+ pass
return channelList
@@ -75,8 +110,6 @@ class Source(object):
id = str(channel.id).replace('/', '')
cacheFile = os.path.join(self.cachePath, self.KEY + '-' + id +
'.programlist')
- print cacheFile
-
try:
cachedOn =
datetime.datetime.fromtimestamp(os.path.getmtime(cacheFile))
cacheHit = cachedOn.day == datetime.datetime.now().day
@@ -89,13 +122,10 @@ class Source(object):
programList = self._getProgramList(channel)
pickle.dump(programList, open(cacheFile, 'w'))
except Exception, ex:
- print "Unable to get program list for channel: " + channel +
"\n" + str(ex)
+ print "[script.tvguide] Unable to get program list for
channel: " + channel + "\n" + str(ex)
else:
programList = pickle.load(open(cacheFile))
- if programList:
- print "Loaded %d programs for channel %s" % (len(programList),
channel.id)
-
return programList
def _getProgramList(self, channel):
@@ -110,10 +140,18 @@ class Source(object):
class DrDkSource(Source):
KEY = 'drdk'
-
CHANNELS_URL =
'http://www.dr.dk/tjenester/programoversigt/dbservice.ashx/getChannels?type=tv'
PROGRAMS_URL =
'http://www.dr.dk/tjenester/programoversigt/dbservice.ashx/getSchedule?channel_source_url=%s&broadcastDate=%s'
+ STREAMS = {
+ 'dr.dk/mas/whatson/channel/DR1' : STREAM_DR1,
+ 'dr.dk/mas/whatson/channel/DR2' : STREAM_DR2,
+ 'dr.dk/external/ritzau/channel/dru' : STREAM_DR_UPDATE,
+ 'dr.dk/mas/whatson/channel/TVR' : STREAM_DR_RAMASJANG,
+ 'dr.dk/mas/whatson/channel/TVK' : STREAM_DR_K,
+ 'dr.dk/mas/whatson/channel/TV' : STREAM_DR_HD
+ }
+
def __init__(self, settings):
Source.__init__(self, settings, False)
self.date = datetime.datetime.today()
@@ -151,8 +189,14 @@ class DrDkSource(Source):
class YouSeeTvSource(Source):
KEY = 'youseetv'
- CHANNELS_URL = 'http://yousee.tv'
- PROGRAMS_URL = 'http://yousee.tv/feeds/tvguide/getprogrammes/?channel=%s'
+ STREAMS = {
+ 1 : STREAM_DR1,
+ 2 : STREAM_DR2,
+ 889 : STREAM_DR_UPDATE,
+ 505: STREAM_DR_RAMASJANG,
+ 504 : STREAM_DR_K,
+ 503 : STREAM_DR_HD
+ }
def __init__(self, settings):
Source.__init__(self, settings, True)
@@ -201,6 +245,15 @@ class TvTidSource(Source):
BASE_URL = 'http://tvtid.tv2.dk%s'
FETCH_URL = BASE_URL % '/js/fetch.js.php/from-%d.js'
+ STREAMS = {
+ 11825154 : STREAM_DR1,
+ 11823606 : STREAM_DR2,
+ 11841417 : STREAM_DR_UPDATE,
+ 25995179 : STREAM_DR_RAMASJANG,
+ 26000893 : STREAM_DR_K,
+ 26005640 : STREAM_DR_HD
+ }
+
def __init__(self, settings):
Source.__init__(self, settings, True)
self.time = time.time()
@@ -214,6 +267,7 @@ class TvTidSource(Source):
channelList = list()
for channel in json['channels']:
+ print str(channel['id']) + " - " + channel['name'].encode('utf-8',
'replace')
logoFile = self.BASE_URL % channel['logo']
c = Channel(id = channel['id'], title = channel['name'], logo =
logoFile)
diff --git a/script.tvguide/strings.py b/script.tvguide/strings.py
index f0efe26..2d850a9 100644
--- a/script.tvguide/strings.py
+++ b/script.tvguide/strings.py
@@ -7,11 +7,18 @@ NO_STREAM_AVAILABLE_LINE1 = 30101
NO_STREAM_AVAILABLE_LINE2 = 30102
CLEAR_CACHE = 30104
-CLEAR_CACHE_DONE = 30105
+CLEAR_NOTIFICATIONS = 30108
+DONE = 30105
-LOAD_ERROR_TITLE = 30110
-LOAD_ERROR_LINE1 = 30111
-LOAD_ERROR_LINE2 = 30112
+LOAD_ERROR_TITLE = 30150
+LOAD_ERROR_LINE1 = 30151
+LOAD_ERROR_LINE2 = 30152
+
+NOTIFICATION_TEMPLATE = 30200
+
+WATCH_CHANNEL = 30300
+REMIND_PROGRAM = 30301
+DONT_REMIND_PROGRAM = 30302
def strings(id, replacements = None):
string = xbmcaddon.Addon(id = 'script.tvguide').getLocalizedString(id)
diff --git a/script.tvguide/ysapi.py b/script.tvguide/ysapi.py
index aaa5736..33abc7c 100644
--- a/script.tvguide/ysapi.py
+++ b/script.tvguide/ysapi.py
@@ -73,10 +73,7 @@ class YouSeeTVGuideApi(YouSeeApi):
if __name__ == '__main__':
api = YouSeeTVGuideApi()
- json = api.channels()
-
- #api = YouSeeMovieApi()
- #print api.moviesInGenre('action')['movies'][0]
+ json = api.programs(1)
s = simplejson.dumps(json, sort_keys=True, indent=' ')
print '\n'.join([l.rstrip() for l in s.splitlines()])
-----------------------------------------------------------------------
Summary of changes:
.gitignore | 4 +
script.cdartmanager/addon.xml | 2 +-
script.cdartmanager/changelog.txt | 4 +
.../resources/language/Dutch/strings.xml | 8 +-
.../resources/lib/musicbrainz_utils.py | 56 +++++---
script.cdartmanager/resources/lib/pre_eden_code.py | 6 +-
script.tvguide/addon.py | 11 +-
script.tvguide/addon.xml | 2 +-
script.tvguide/changelog.txt | 5 +
script.tvguide/clear_cache.py | 5 +-
script.tvguide/gui.py | 109 ++++++++++----
script.tvguide/notification.py | 121 +++++++++++++++
.../resources/language/Danish/strings.xml | 19 ++-
.../resources/language/English/strings.xml | 17 ++-
script.tvguide/resources/settings.xml | 9 +
.../skins/Default/720p/script-tvguide-info.xml | 42 ------
.../skins/Default/720p/script-tvguide-main.xml | 154 +++++++++++++-------
.../skins/Default/720p/script-tvguide-menu.xml | 67 +++++++++
.../skins/Default/media/cell-bg-selected.png | Bin 5933 -> 0 bytes
.../resources/skins/Default/media/cell-bg.png | Bin 7457 -> 0 bytes
.../Default/media/tvguide-background-default.jpg | Bin 0 -> 16124 bytes
.../skins/Default/media/tvguide-background.png | Bin 243177 -> 5419 bytes
.../Default/media/tvguide-program-grey-focus.png | Bin 0 -> 6092 bytes
.../skins/Default/media/tvguide-program-grey.png | Bin 0 -> 4453 bytes
.../Default/media/tvguide-program-red-focus.png | Bin 0 -> 3503 bytes
.../skins/Default/media/tvguide-program-red.png | Bin 0 -> 3105 bytes
script.tvguide/service.py | 16 +-
script.tvguide/source.py | 90 +++++++++---
script.tvguide/strings.py | 15 ++-
script.tvguide/ysapi.py | 5 +-
30 files changed, 563 insertions(+), 204 deletions(-)
create mode 100644 script.tvguide/notification.py
delete mode 100644
script.tvguide/resources/skins/Default/720p/script-tvguide-info.xml
create mode 100644
script.tvguide/resources/skins/Default/720p/script-tvguide-menu.xml
delete mode 100644
script.tvguide/resources/skins/Default/media/cell-bg-selected.png
delete mode 100644 script.tvguide/resources/skins/Default/media/cell-bg.png
create mode 100644
script.tvguide/resources/skins/Default/media/tvguide-background-default.jpg
create mode 100644
script.tvguide/resources/skins/Default/media/tvguide-program-grey-focus.png
create mode 100644
script.tvguide/resources/skins/Default/media/tvguide-program-grey.png
create mode 100644
script.tvguide/resources/skins/Default/media/tvguide-program-red-focus.png
create mode 100644
script.tvguide/resources/skins/Default/media/tvguide-program-red.png
hooks/post-receive
--
Scripts
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons