The branch, eden has been updated
via 589f46e967073303ae5d2850101e351083bf51bf (commit)
via b9fabe15a56c38fb9fa322e55a6ce434cccf0b94 (commit)
from 7a90d76510160fb5eab65ea7c7d86120e98a33c3 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=589f46e967073303ae5d2850101e351083bf51bf
commit 589f46e967073303ae5d2850101e351083bf51bf
Author: spiff <[email protected]>
Date: Wed Oct 17 13:37:30 2012 +0200
[plugin.video.borsentv.dk] updated to version 1.0.4
diff --git a/.gitignore b/.gitignore
index 03ad345..47364d3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -101,5 +101,5 @@ plugin.video.filmarkivet/.gitignore
plugin.video.videovideo.dk/.git
plugin.video.videovideo.dk/.idea
plugin.video.nolife/.hg
-plugin.video.borsentv/.idea
-plugin.video.borsentv/.git
+plugin.video.borsentv.dk/.idea
+plugin.video.borsentv.dk/.git
diff --git a/plugin.video.borsentv.dk/addon.py
b/plugin.video.borsentv.dk/addon.py
index 16617b9..5920969 100644
--- a/plugin.video.borsentv.dk/addon.py
+++ b/plugin.video.borsentv.dk/addon.py
@@ -19,10 +19,6 @@
#
import os
import sys
-import urlparse
-import urllib2
-import re
-import datetime
import buggalo
@@ -33,18 +29,20 @@ import xbmcplugin
BASE_URL = 'http://borsen.dk/tv/'
FEEDS = {
30100 : 'rss://borsen.dk/podcast/alle',
- 30108 : 'rss://borsen.dk/podcast/investor1000',
30101 : 'rss://borsen.dk/podcast/investor',
- 30106 : 'rss://borsen.dk/podcast/karriere',
+ 30102 : 'rss://borsen.dk/podcast/investor1000',
+ 30103 : 'rss://borsen.dk/podcast/karriere',
30104 : 'rss://borsen.dk/podcast/politik',
- 30103 : 'rss://borsen.dk/podcast/politik',
- 30102 : 'rss://borsen.dk/podcast/politik'
+ 30105 : 'rss://borsen.dk/podcast/privatokonomi',
+ 30106 : 'rss://borsen.dk/podcast/okonomi',
+ 30107 : 'rss://borsen.dk/podcast/finans'
}
class BorsenTVAddon(object):
def showCategories(self):
for id in FEEDS.keys():
item = xbmcgui.ListItem(ADDON.getLocalizedString(id), iconImage =
ICON)
+ item.setProperty('Fanart_Image', FANART)
xbmcplugin.addDirectoryItem(HANDLE, FEEDS[id], item, isFolder =
True)
xbmcplugin.endOfDirectory(HANDLE)
@@ -53,6 +51,7 @@ if __name__ == '__main__':
ADDON = xbmcaddon.Addon()
HANDLE = int(sys.argv[1])
ICON = os.path.join(ADDON.getAddonInfo('path'), 'icon.png')
+ FANART = os.path.join(ADDON.getAddonInfo('path'), 'fanart.jpg')
buggalo.SUBMIT_URL = 'http://tommy.winther.nu/exception/submit.php'
try:
diff --git a/plugin.video.borsentv.dk/addon.xml
b/plugin.video.borsentv.dk/addon.xml
index 2400ebc..df9eb06 100644
--- a/plugin.video.borsentv.dk/addon.xml
+++ b/plugin.video.borsentv.dk/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.borsentv.dk" version="1.0.3" name="Børsen TV"
provider-name="twinther [[email protected]]">
+<addon id="plugin.video.borsentv.dk" version="1.0.4" name="Børsen TV"
provider-name="twinther [[email protected]]">
<requires>
<import addon="xbmc.python" version="2.0"/>
<import addon="script.module.buggalo" version="1.0.1"/>
diff --git a/plugin.video.borsentv.dk/changelog.txt
b/plugin.video.borsentv.dk/changelog.txt
index 84acd80..f5ca9e6 100644
--- a/plugin.video.borsentv.dk/changelog.txt
+++ b/plugin.video.borsentv.dk/changelog.txt
@@ -1,3 +1,6 @@
+[B]Version 1.0.4 - 2012-10-10[/B]
+- Updated feeds, icon and fanart (Thanks to Thomas Riise)
+
[B]Version 1.0.3 - 2012-10-03[/B]
- Changed addon to use RSS feeds to greatly simplify the codebase
diff --git a/plugin.video.borsentv.dk/icon.png
b/plugin.video.borsentv.dk/icon.png
index a108c4c..0ce31d1 100644
Binary files a/plugin.video.borsentv.dk/icon.png and
b/plugin.video.borsentv.dk/icon.png differ
diff --git a/plugin.video.borsentv.dk/resources/language/Danish/strings.xml
b/plugin.video.borsentv.dk/resources/language/Danish/strings.xml
index aec4ff9..c073ef2 100644
--- a/plugin.video.borsentv.dk/resources/language/Danish/strings.xml
+++ b/plugin.video.borsentv.dk/resources/language/Danish/strings.xml
@@ -2,11 +2,10 @@
<strings>
<string id="30100">Alle</string>
<string id="30101">Investor</string>
- <string id="30102">Privatøkonomi</string>
- <string id="30103">Ãkonomi</string>
+ <string id="30102">Investor 1000</string>
+ <string id="30103">Karriere</string>
<string id="30104">Politik</string>
- <string id="30105">IT</string>
- <string id="30106">Karriere</string>
- <string id="30107">Weekend</string>
- <string id="30108">Investor 1000</string>
+ <string id="30105">Privatøkonomi</string>
+ <string id="30106">Ãkonomi</string>
+ <string id="30107">Finans</string>
</strings>
\ No newline at end of file
diff --git a/plugin.video.borsentv.dk/resources/language/English/strings.xml
b/plugin.video.borsentv.dk/resources/language/English/strings.xml
index c12ef92..6312020 100644
--- a/plugin.video.borsentv.dk/resources/language/English/strings.xml
+++ b/plugin.video.borsentv.dk/resources/language/English/strings.xml
@@ -2,11 +2,10 @@
<strings>
<string id="30100">All</string>
<string id="30101">Investor</string>
- <string id="30102">Private economy</string>
- <string id="30103">Economy</string>
+ <string id="30102">Investor 1000</string>
+ <string id="30103">Career</string>
<string id="30104">Politics</string>
- <string id="30105">IT</string>
- <string id="30106">Career</string>
- <string id="30107">Weekend</string>
- <string id="30108">Investor 1000</string>
+ <string id="30105">Private economy</string>
+ <string id="30106">Economy</string>
+ <string id="30107">Finance</string>
</strings>
\ No newline at end of file
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=b9fabe15a56c38fb9fa322e55a6ce434cccf0b94
commit b9fabe15a56c38fb9fa322e55a6ce434cccf0b94
Author: spiff <[email protected]>
Date: Wed Oct 17 13:35:47 2012 +0200
[plugin.video.sagetv] updated to version 1.3.1
diff --git a/plugin.video.sagetv/addon.xml b/plugin.video.sagetv/addon.xml
index 76f773d..ca45e4a 100644
--- a/plugin.video.sagetv/addon.xml
+++ b/plugin.video.sagetv/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.sagetv"
name="SageTV"
- version="1.2.6"
+ version="1.3.1"
provider-name="kricker,lehighbri,aaronb">
<requires>
<import addon="xbmc.python" version="2.0"/>
diff --git a/plugin.video.sagetv/changelog.txt
b/plugin.video.sagetv/changelog.txt
index 68fe87a..f984460 100644
--- a/plugin.video.sagetv/changelog.txt
+++ b/plugin.video.sagetv/changelog.txt
@@ -1,3 +1,29 @@
+[B]Version 1.3.1 (Oct 13, 2012)[/B]
+- Added "Watch (Streamed)" context menu item which enables playing back via
using SageTV remote services
+- Fixed file/watched duration issue where "None" wasn't handled
+
+[B]Version 1.3.0 (Oct 9, 2012)[/B]
+- Added support for playing back recordings that have multiple segments (using
stack://)
+
+[B]Version 1.2.12 (Oct 8, 2012)[/B]
+- Added "Add Favorite" context menu item (for airings and searches)
+
+[B]Version 1.2.11 (Oct 8, 2012)[/B]
+- Added "Delete/Wrong Recording" context menu item
+
+[B]Version 1.2.10 (Oct 8, 2012)[/B]
+- Added "Delete/Set Watched", "Delete/Clear Watched", and "Delete/Don't Like"
context menu items
+
+[B]Version 1.2.9 (Oct 8, 2012)[/B]
+- Added "Archive" context menu item
+
+[B]Version 1.2.8 (Oct 8, 2012)[/B]
+- Added support for playing back recordings that have multiple segments
+- Added "Set Watched" and "Clear Watched" context menu items
+
+[B]Version 1.2.7 (Oct 5, 2012)[/B]
+- Added support for background fanart
+
[B]Version 1.2.6 (Oct 1, 2012)[/B]
- Updated playback path settings to require you to browse for it vs. free-text
to ensure the path that is used for live TV playback is correctly formatted
- Added resume/partially watched support (e.g. if you've started to watch a
show in SageTV, XBMC will know this and prompt you if you want to resume at the
same point in SageTV); note that this does NOT sync the progress or watched
status from XBMC back to SageTV
@@ -41,6 +67,3 @@
[B]Version 1.0.0 (Sep 11, 2012)[/B]
- Initial commit to Eden add-on system
-
-TODO:
--Sync watched status
\ No newline at end of file
diff --git a/plugin.video.sagetv/contextmenuactions.py
b/plugin.video.sagetv/contextmenuactions.py
index a3f8326..5ca7d57 100644
--- a/plugin.video.sagetv/contextmenuactions.py
+++ b/plugin.video.sagetv/contextmenuactions.py
@@ -1,4 +1,4 @@
-import urllib,urllib2,re
+import urllib,urllib2,re,string
import xbmc,xbmcplugin,xbmcgui,xbmcaddon
from time import sleep
import simplejson as json
@@ -9,6 +9,8 @@ sage_mac = __settings__.getSetting("sage_mac")
DEFAULT_CHARSET = 'utf-8'
+MIN_VERSION_STREAMING_SERVICES_PLUGIN_REQUIRED = "1.3.7.59"
+
def executeSagexAPIJSONCall(url, resultToGet):
print "*** sagex request URL:" + url
@@ -54,6 +56,35 @@ def unicodeToStr(obj):
else:
return obj # leave numbers and booleans alone
+def comparePluginVersions(s1, s2):
+
+ # See if they are equal.
+ if s1 == s2:
+ return 0
+
+ # Make sure they are the same length.
+ str1 = normalizePluginString(s1, len(string.split(s2, '.')))
+ str2 = normalizePluginString(s2, len(string.split(s1, '.')))
+
+ # Split into parts separated by '.'
+ p1 = string.split(str1, '.')
+ p2 = string.split(str2, '.')
+
+ for i in range(len(p1)):
+ int1 = int(p1[i])
+ int2 = int(p2[i])
+ if int1 < int2:
+ return -1
+ elif int2 < int1:
+ return 1
+
+ return 0
+
+def normalizePluginString(s, l):
+ while len(string.split(s, '.')) < l:
+ s += ".0"
+ return s
+
# SageTV recording Directories for path replacement
sage_rec = __settings__.getSetting("sage_rec")
sage_unc = __settings__.getSetting("sage_unc")
@@ -87,14 +118,68 @@ def filemap(filepath):
#Get the passed in argument from the addContextMenuItems() call in default.py
args = sys.argv[1].split("|")
-if(args[0] in ["delete","cancelrecording","removefavorite","record"]):
+if(args[0] in
["cancelrecording","addfavorite","removefavorite","record","setwatched","clearwatched","setarchived","cleararchived"]):
sageApiUrl = args[1]
urllib.urlopen(sageApiUrl)
+ if(args[0] == "record"):
+ xbmc.executebuiltin("Notification(" + __language__(21011) + "," +
__language__(21013) + ")")
+ elif(args[0] == "addfavorite"):
+ xbmc.executebuiltin("Notification(" + __language__(21011) + "," +
__language__(21031) + ")")
+ elif(args[0] == "removefavorite"):
+ xbmc.executebuiltin("Notification(" + __language__(21011) + "," +
__language__(21032) + ")")
+ elif(args[0] == "setwatched"):
+ xbmc.executebuiltin("Notification(" + __language__(21011) + "," +
__language__(21033) + ")")
+ elif(args[0] == "clearwatched"):
+ xbmc.executebuiltin("Notification(" + __language__(21011) + "," +
__language__(21034) + ")")
+ elif(args[0] == "setarchived"):
+ xbmc.executebuiltin("Notification(" + __language__(21011) + "," +
__language__(21035) + ")")
+ elif(args[0] == "cleararchived"):
+ xbmc.executebuiltin("Notification(" + __language__(21011) + "," +
__language__(21036) + ")")
+ xbmc.executebuiltin("Container.Refresh")
+elif(args[0][0:6] == "delete"):
+ firstApiCall = args[1]
+ #Check what kind of delete command was sent
+ deleteCommand = args[0].replace("delete","")
+ if(deleteCommand != "" and deleteCommand != "wrongrecording"):
+ secondApiCall = args[2]
+ urllib.urlopen(firstApiCall)
+ urllib.urlopen(secondApiCall)
+ else:
+ urllib.urlopen(firstApiCall)
+
if(args[0] == "delete"):
xbmc.executebuiltin("Notification(" + __language__(21011) + "," +
__language__(21012) + ")")
- elif(args[0] == "record"):
- xbmc.executebuiltin("Notification(" + __language__(21011) + "," +
__language__(21013) + ")")
xbmc.executebuiltin("Container.Refresh")
+elif(args[0] == "watchstream"):
+ strUrl = args[1]
+ mediaFileID = args[2]
+ streamingUrl = strUrl + "/stream/HTTPLiveStreamingPlaylist?MediaFileId=" +
mediaFileID
+ #First check that the media streaming services plugin is installed
+ validStreamingServicesPluginVersionFound = True
+ url = strUrl + '/sagex/api?command=GetInstalledPlugins&encoder=json'
+ plugins = executeSagexAPIJSONCall(url, "Result")
+
+ if(plugins == None or len(plugins) == 0):
+ print "SageTV not detected, or required plugins not installed"
+
xbmcgui.Dialog().ok(__language__(21000),__language__(21001),__language__(21002),__language__(21003))
+ validStreamingServicesPluginVersionFound = False
+
+ streamingServicesPluginVersion = ""
+ for plugin in plugins:
+ if(plugin.get("PluginIdentifier") == "mediastreaming"):
+ streamingServicesPluginVersion = plugin.get("PluginVersion")
+
+ print "***SageTV mediastreaming plugin version installed=" +
streamingServicesPluginVersion
+ if(streamingServicesPluginVersion == ""):
+ xbmcgui.Dialog().ok(__language__(21004),__language__(21038) + " " +
MIN_VERSION_STREAMING_SERVICES_PLUGIN_REQUIRED,
__language__(21039),__language__(21040))
+ validStreamingServicesPluginVersionFound = False
+ if(comparePluginVersions(streamingServicesPluginVersion,
MIN_VERSION_STREAMING_SERVICES_PLUGIN_REQUIRED) < 0):
+ xbmcgui.Dialog().ok(__language__(21004),__language__(21038) + " " +
MIN_VERSION_STREAMING_SERVICES_PLUGIN_REQUIRED, __language__(21008) + " " +
streamingServicesPluginVersion,__language__(21041) + " " +
MIN_VERSION_STREAMING_SERVICES_PLUGIN_REQUIRED)
+ validStreamingServicesPluginVersionFound = False
+
+ if(validStreamingServicesPluginVersionFound):
+ print "**Attempting to playback stream of recording; streaming URL=" +
streamingUrl
+ xbmc.executebuiltin('PlayMedia("%s")' % streamingUrl)
elif(args[0] == "watchnow"):
xbmc.executebuiltin("Notification(" + __language__(21011) + "," +
__language__(21014) + ")")
strUrl = args[1]
diff --git a/plugin.video.sagetv/default.py b/plugin.video.sagetv/default.py
index 10cde6d..c1a3c6f 100644
--- a/plugin.video.sagetv/default.py
+++ b/plugin.video.sagetv/default.py
@@ -51,7 +51,7 @@ strUrl = 'http://' + __settings__.getSetting("sage_user") +
':' + __settings__.g
IMAGE_POSTER =
xbmc.translatePath(os.path.join(__cwd__,'resources','media','poster.jpg'))
IMAGE_THUMB =
xbmc.translatePath(os.path.join(__cwd__,'resources','media','thumb.jpg'))
DEFAULT_CHARSET = 'utf-8'
-MIN_VERSION_SAGEX_REQUIRED = "7.1.9.10"
+MIN_VERSION_SAGEX_REQUIRED = "7.1.9.12"
# 500-THUMBNAIL 501/502/505/506/507/508-LIST 503-MINFO2 504-MINFO 515-MINFO3
confluence_views = [500,501,502,503,504,508]
@@ -70,15 +70,15 @@ def TOPLEVELCATEGORIES():
print "Successfully able to connect to the SageTV server @ " +
__settings__.getSetting("sage_ip") + ':' + __settings__.getSetting("sage_port")
sagexVersion = ""
for plugin in plugins:
- if(plugin.get("PluginIdentifier") == "sagex-api"):
+ if(plugin.get("PluginIdentifier") == "sagex-api-services"):
sagexVersion = plugin.get("PluginVersion")
- print "TOPLEVELCATEGORIES STARTED; sagex-api version=" + sagexVersion
+ print "TOPLEVELCATEGORIES STARTED; sagex-api-services version=" +
sagexVersion
if(sagexVersion == ""):
xbmcgui.Dialog().ok(__language__(21004),__language__(21005) + " " +
MIN_VERSION_SAGEX_REQUIRED, __language__(21006),__language__(21007))
return
if(comparePluginVersions(sagexVersion, MIN_VERSION_SAGEX_REQUIRED) < 0):
- xbmcgui.Dialog().ok(__language__(21004),__language__(21005) +
MIN_VERSION_SAGEX_REQUIRED, __language__(21008) + " " +
sagexVersion,__language__(21009) + " " + MIN_VERSION_SAGEX_REQUIRED)
+ xbmcgui.Dialog().ok(__language__(21004),__language__(21005) + " " +
MIN_VERSION_SAGEX_REQUIRED, __language__(21008) + " " +
sagexVersion,__language__(21009) + " " + MIN_VERSION_SAGEX_REQUIRED)
return
addTopLevelDir('1. Watch Recordings', strUrl +
'/sagex/api?c=xbmc:GetTVMediaFilesGroupedByTitle&size=500&encoder=json',1,IMAGE_POSTER,'Browse
previously recorded and currently recording shows')
@@ -94,7 +94,7 @@ def VIEWLISTOFRECORDEDSHOWS(url,name):
now = time.time()
strNowObject = date.fromtimestamp(now)
now = "%02d.%02d.%s" % (strNowObject.day+1, strNowObject.month,
strNowObject.year)
- addDir('[All Shows]',strUrl +
'/sagex/api?c=xbmc:GetMediaFilesForShowWithSubsetOfProperties&1=&size=500&encoder=json',11,IMAGE_POSTER,IMAGE_THUMB,'',now)
+ addDir('[All Shows]',strUrl +
'/sagex/api?c=xbmc:GetMediaFilesForShowWithSubsetOfProperties&1=&size=500&encoder=json',11,IMAGE_POSTER,IMAGE_THUMB,'',now,'')
titleObjects = executeSagexAPIJSONCall(url, "Result")
titles = titleObjects.keys()
for title in titles:
@@ -113,8 +113,9 @@ def VIEWLISTOFRECORDEDSHOWS(url,name):
#urlToShowEpisodes = strUrl +
'/sage/Search?searchType=TVFiles&SearchString=' +
urllib2.quote(strTitle.encode("utf8")) +
'&DVD=on&sort2=airdate_asc&partials=both&TimeRange=0&pagelen=100&sort1=title_asc&filename=&Video=on&search_fields=title&xml=yes'
print "ADDING strTitle=" + strTitle + "; urlToShowEpisodes=" +
urlToShowEpisodes
imageUrl = strUrl + "/sagex/media/poster/" + strMediaFileID
+ fanartUrl = strUrl + "/sagex/media/background/" + strMediaFileID
#print "ADDING imageUrl=" + imageUrl
- addDir(strTitle,
urlToShowEpisodes,11,imageUrl,'',strExternalID,strAiringdate)
+ addDir(strTitle,
urlToShowEpisodes,11,imageUrl,'',strExternalID,strAiringdate,fanartUrl)
def VIEWLISTOFEPISODESFORSHOW(url,name):
mfs = executeSagexAPIJSONCall(url, "Result")
@@ -137,9 +138,10 @@ def VIEWLISTOFEPISODESFORSHOW(url,name):
episodeNum = int(mfSubset.get("EpisodeNumber"))
studio = mfSubset.get("AiringChannelName")
isFavorite = mfSubset.get("IsFavorite")
- watchedDuration = mfSubset.get("WatchedDuration") // 1000
- fileDuration = mfSubset.get("FileDuration") // 1000
+ watchedDuration = mfSubset.get("WatchedDuration", 0) // 1000
+ fileDuration = mfSubset.get("FileDuration", 0) // 1000
isWatched = mfSubset.get("IsWatched")
+ isArchived = mfSubset.get("IsLibraryFile")
startTime = float(mfSubset.get("AiringStartTime") // 1000)
strAiringdateObject = date.fromtimestamp(startTime)
@@ -169,10 +171,23 @@ def VIEWLISTOFEPISODESFORSHOW(url,name):
else:
strDisplayText = strTitle
- strFilepath = mfSubset.get("SegmentFiles")[0]
+ segs = mfSubset.get("SegmentFiles")
+ if(len(segs) == 1):
+ strMappedFilepath = filemap(mfSubset.get("SegmentFiles")[0])
+ else:
+ #If a recording has multiple segments, stack them to group the
segments together such that during playback it's transparent to the user
+ strMappedFilepath = "stack://"
+ for seg in segs:
+ strMappedFilepath = strMappedFilepath + filemap(seg) + " , "
+ #Once the stack:// is generated, remove the extraneous " , " at
the end of it
+ strMappedFilepath = strMappedFilepath[0:len(strMappedFilepath)-3]
+ #strMappedFilepath = strUrl +
'/sagex/api?c=xbmc:GetPlaylistOfSegmentsForMediafile&1=%s&2=%s&3=%s&raw_content_type=audio/mpegurl&encoder=raw'
% (strMediaFileID, urllib2.quote(sage_rec.encode("utf8")),
urllib2.quote(sage_unc.encode("utf8")))
+ print "************SEGS=" + str(segs)
+ print "************strMappedFilepath=" + str(strMappedFilepath)
imageUrl = strUrl + "/sagex/media/poster/" + strMediaFileID
-
addMediafileLink(strDisplayText,filemap(strFilepath),strDescription,imageUrl,strGenre,strOriginalAirdate,strAiringdate,strTitle,strMediaFileID,strAiringID,seasonNum,episodeNum,studio,isFavorite,isWatched,watchedDuration,fileDuration)
+ fanartUrl = strUrl + "/sagex/media/background/" + strMediaFileID
+
addMediafileLink(strDisplayText,strMappedFilepath,strDescription,imageUrl,strGenre,strOriginalAirdate,strAiringdate,strTitle,strMediaFileID,strAiringID,seasonNum,episodeNum,studio,isFavorite,isWatched,watchedDuration,fileDuration,fanartUrl,isArchived)
xbmc.executebuiltin("Container.SetViewMode(504)")
@@ -299,6 +314,8 @@ def VIEWAIRINGSONCHANNEL(url,name):
def SEARCHFORRECORDINGS(url,name):
titleToSearchFor = common.getUserInput(__language__(21010),"")
+ if(titleToSearchFor == "" or titleToSearchFor == None):
+ return
url = strUrl +
'/sagex/api?c=xbmc:SearchForMediaFiles&1=%s&size=100&encoder=json' %
urllib2.quote(titleToSearchFor.encode("utf8"))
#url = strUrl +
'/sagex/api?command=EvaluateExpression&1=FilterByMethod(GetMediaFiles("T"),
"GetMediaTitle", "' + urllib2.quote(titleToSearchFor.encode("utf8")) + '",
true)&size=100&encoder=json'
mfs = executeSagexAPIJSONCall(url, "Result")
@@ -322,9 +339,10 @@ def SEARCHFORRECORDINGS(url,name):
episodeNum = int(mfSubset.get("EpisodeNumber"))
studio = mfSubset.get("AiringChannelName")
isFavorite = mfSubset.get("IsFavorite")
- watchedDuration = mfSubset.get("WatchedDuration") // 1000
- fileDuration = mfSubset.get("FileDuration") // 1000
+ watchedDuration = mfSubset.get("WatchedDuration", 0) // 1000
+ fileDuration = mfSubset.get("FileDuration", 0) // 1000
isWatched = mfSubset.get("IsWatched")
+ isArchived = mfSubset.get("IsLibraryFile")
startTime = float(mfSubset.get("AiringStartTime") // 1000)
strAiringdateObject = date.fromtimestamp(startTime)
@@ -352,15 +370,30 @@ def SEARCHFORRECORDINGS(url,name):
strDescription = strGenre
- strFilepath = mfSubset.get("SegmentFiles")[0]
+ segs = mfSubset.get("SegmentFiles")
+ if(len(segs) == 1):
+ strMappedFilepath = filemap(mfSubset.get("SegmentFiles")[0])
+ else:
+ #If a recording has multiple segments, stack them to group the
segments together such that during playback it's transparent to the user
+ strMappedFilepath = "stack://"
+ for seg in segs:
+ strMappedFilepath = strMappedFilepath + filemap(seg) + " , "
+ #Once the stack:// is generated, remove the extraneous " , " at
the end of it
+ strMappedFilepath = strMappedFilepath[0:len(strMappedFilepath)-3]
+ #strMappedFilepath = strUrl +
'/sagex/api?c=xbmc:GetPlaylistOfSegmentsForMediafile&1=%s&2=%s&3=%s&raw_content_type=audio/mpegurl&encoder=raw'
% (strMediaFileID, urllib2.quote(sage_rec.encode("utf8")),
urllib2.quote(sage_unc.encode("utf8")))
+ print "************SEGS=" + str(segs)
+ print "************strMappedFilepath=" + str(strMappedFilepath)
imageUrl = strUrl + "/sagex/media/poster/" + strMediaFileID
-
addMediafileLink(strDisplayText,filemap(strFilepath),strDescription,imageUrl,strGenre,strOriginalAirdate,strAiringdate,strTitle,strMediaFileID,strAiringID,seasonNum,episodeNum,studio,isFavorite,isWatched,watchedDuration,fileDuration)
+ fanartUrl = strUrl + "/sagex/media/background/" + strMediaFileID
+
addMediafileLink(strDisplayText,strMappedFilepath,strDescription,imageUrl,strGenre,strOriginalAirdate,strAiringdate,strTitle,strMediaFileID,strAiringID,seasonNum,episodeNum,studio,isFavorite,isWatched,watchedDuration,fileDuration,fanartUrl,isArchived)
xbmc.executebuiltin("Container.SetViewMode(504)")
def SEARCHFORAIRINGS(url,name):
titleToSearchFor = common.getUserInput(__language__(21010),"")
+ if(titleToSearchFor == "" or titleToSearchFor == None):
+ return
now = time.time()
startRange = str(long(now * 1000))
#url = strUrl +
'/sagex/api?command=EvaluateExpression&1=FilterByRange(SearchByTitle("%s","T"),"GetAiringStartTime","%s",java_lang_Long_MAX_VALUE,true)&encoder=json'
% (urllib2.quote(titleToSearchFor.encode("utf8")), startRange)
@@ -428,35 +461,61 @@ def get_params():
return param
-def
addMediafileLink(name,url,plot,iconimage,genre,originalairingdate,airingdate,showtitle,mediafileid,airingid,seasonnum,episodenum,studio,isfavorite,iswatched,resumetime,totaltime):
+def
addMediafileLink(name,url,plot,iconimage,genre,originalairingdate,airingdate,showtitle,mediafileid,airingid,seasonnum,episodenum,studio,isfavorite,iswatched,resumetime,totaltime,fanartimage,isArchived):
ok=True
liz=xbmcgui.ListItem(name)
scriptToRun =
"special://home/addons/plugin.video.sagetv/contextmenuactions.py"
actionDelete = "delete|" + strUrl +
'/sagex/api?command=DeleteFile&1=mediafile:' + mediafileid
+ actionDeleteSetWatched = "deletesetwatched|" + strUrl +
'/sagex/api?command=SetWatched&1=mediafile:' + mediafileid + "|" + strUrl +
'/sagex/api?command=DeleteFile&1=mediafile:' + mediafileid
+ actionDeleteClearWatched = "deleteclearwatched|" + strUrl +
'/sagex/api?command=ClearWatched&1=mediafile:' + mediafileid + "|" + strUrl +
'/sagex/api?command=DeleteFile&1=mediafile:' + mediafileid
+ actionDeleteDontLike = "deletedontlike|" + strUrl +
'/sagex/api?command=SetDontLike&1=mediafile:' + mediafileid + "|" + strUrl +
'/sagex/api?command=DeleteFile&1=mediafile:' + mediafileid
+ actionDeleteWrongRecording = "deletewrongrecording|" + strUrl +
'/sagex/api?command=DeleteFileWithoutPrejudice&1=mediafile:' + mediafileid
+ actionSetWatched = "setwatched|" + strUrl +
'/sagex/api?command=SetWatched&1=mediafile:' + mediafileid
+ actionClearWatched = "clearwatched|" + strUrl +
'/sagex/api?command=ClearWatched&1=mediafile:' + mediafileid
+ actionSetArchived = "setarchived|" + strUrl +
'/sagex/api?command=MoveFileToLibrary&1=mediafile:' + mediafileid
+ actionClearArchived = "cleararchived|" + strUrl +
'/sagex/api?command=MoveTVFileOutOfLibrary&1=mediafile:' + mediafileid
actionCancelRecording = "cancelrecording|" + strUrl +
'/sagex/api?command=CancelRecord&1=mediafile:' + mediafileid
actionRemoveFavorite = "removefavorite|" + strUrl +
'/sagex/api?command=EvaluateExpression&1=RemoveFavorite(GetFavoriteForAiring(GetAiringForID('
+ airingid + ')))'
+ actionWatchStream = "watchstream|" + strUrl + "|" + mediafileid
+
bisAiringRecording = isAiringRecording(airingid)
+ contextMenuItems = []
+
if(bisAiringRecording):
- if(isfavorite):
- liz.addContextMenuItems([(__language__(21016), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionDelete + ')'), (__language__(21017),
'XBMC.RunScript(' + scriptToRun + ', ' + actionCancelRecording + ')'),
(__language__(21018), 'XBMC.RunScript(' + scriptToRun + ', ' +
actionRemoveFavorite + ')')], True)
- else:
- liz.addContextMenuItems([(__language__(21016), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionDelete + ')'), (__language__(21017),
'XBMC.RunScript(' + scriptToRun + ', ' + actionCancelRecording + ')')], True)
+ contextMenuItems.append((__language__(21017), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionCancelRecording + ')'))
+ if(isfavorite):
+ contextMenuItems.append((__language__(21018),
'XBMC.RunScript(' + scriptToRun + ', ' + actionRemoveFavorite + ')'))
else:
- if(isfavorite):
- liz.addContextMenuItems([(__language__(21016), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionDelete + ')'), (__language__(21018),
'XBMC.RunScript(' + scriptToRun + ', ' + actionRemoveFavorite + ')')], True)
- liz.addContextMenuItems([(__language__(21016), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionDelete + ')')], True)
+ if(isfavorite):
+ contextMenuItems.append((__language__(21018),
'XBMC.RunScript(' + scriptToRun + ', ' + actionRemoveFavorite + ')'))
if(iswatched):
+ contextMenuItems.append((__language__(21023), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionClearWatched + ')'))
liz.setInfo( type="Video", infoLabels={ "Title": name, "Plot":
plot, "Genre": genre, "date": airingdate, "premiered": originalairingdate,
"aired": originalairingdate, "TVShowTitle": showtitle, "season": seasonnum,
"episode": episodenum, "studio": studio, "overlay": 7, "playcount": 1 } )
else:
- liz.setProperty("resumetime",str(resumetime))
- liz.setProperty("totaltime",str(totaltime))
+ contextMenuItems.append((__language__(21022), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionSetWatched + ')'))
+ if(resumetime != 0 and totaltime != 0):
+ liz.setProperty("resumetime",str(resumetime))
+ liz.setProperty("totaltime",str(totaltime))
liz.setInfo( type="Video", infoLabels={ "Title": name, "Plot":
plot, "Genre": genre, "date": airingdate, "premiered": originalairingdate,
"aired": originalairingdate, "TVShowTitle": showtitle, "season": seasonnum,
"episode": episodenum, "studio": studio, "overlay": 6, "playcount": 0 } )
+ if(isArchived):
+ contextMenuItems.append((__language__(21025), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionClearArchived + ')'))
+ else:
+ contextMenuItems.append((__language__(21024), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionSetArchived + ')'))
+
+ contextMenuItems.append((__language__(21016), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionDelete + ')'))
+ contextMenuItems.append((__language__(21026), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionDeleteSetWatched + ')'))
+ contextMenuItems.append((__language__(21027), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionDeleteClearWatched + ')'))
+ contextMenuItems.append((__language__(21028), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionDeleteDontLike + ')'))
+ contextMenuItems.append((__language__(21029), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionDeleteWrongRecording + ')'))
+ contextMenuItems.append((__language__(21037), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionWatchStream + ')'))
+ liz.addContextMenuItems(contextMenuItems, True)
liz.setIconImage(iconimage)
liz.setThumbnailImage(iconimage)
+ liz.setProperty("fanart_image",fanartimage)
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz,isFolder=False)
return ok
@@ -465,29 +524,37 @@ def
addAiringLink(name,url,plot,iconimage,genre,originalairingdate,airingdate,sh
liz=xbmcgui.ListItem(name)
scriptToRun =
"special://home/addons/plugin.video.sagetv/contextmenuactions.py"
actionCancelRecording = "cancelrecording|" + strUrl +
'/sagex/api?command=CancelRecord&1=airing:' + airingid
+ actionAddFavorite = "addfavorite|" + strUrl +
'/sagex/api?command=AddFavorite&1=%s&2=true&3=true&4=&5=&6=&7=&8=&9=&10=&11=&12=&13=&14='
% showtitle
actionRemoveFavorite = "removefavorite|" + strUrl +
'/sagex/api?command=EvaluateExpression&1=RemoveFavorite(GetFavoriteForAiring(GetAiringForID('
+ airingid + ')))'
actionRecord = "record|" + strUrl + '/sagex/api?command=Record&1=airing:'
+ airingid
actionWatchNow = "watchnow|" + strUrl + "|" + airingid
bisAiringScheduledToRecord = isAiringScheduledToRecord(airingid)
+ contextMenuItems = []
+
if(bisAiringScheduledToRecord):
+ contextMenuItems.append((__language__(21017), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionCancelRecording + ')'))
if(isfavorite):
- liz.addContextMenuItems([(__language__(21017), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionCancelRecording + ')'), (__language__(21018),
'XBMC.RunScript(' + scriptToRun + ', ' + actionRemoveFavorite + ')')], True)
+ contextMenuItems.append((__language__(21018), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionRemoveFavorite + ')'))
else:
- liz.addContextMenuItems([(__language__(21017), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionCancelRecording + ')')], True)
+ contextMenuItems.append((__language__(21030), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionAddFavorite + ')'))
else:
if(isfavorite):
- liz.addContextMenuItems([('Record', 'XBMC.RunScript(' +
scriptToRun + ', ' + actionRecord + ')'), (__language__(21018),
'XBMC.RunScript(' + scriptToRun + ', ' + actionRemoveFavorite + ')')], True)
+ contextMenuItems.append((__language__(21019), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionRecord + ')'))
+ contextMenuItems.append((__language__(21018), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionRemoveFavorite + ')'))
else:
#Check if an airing is airing live right now; if it is, provide
the ability to watch it live
bisAiringLiveNow = isAiringLiveNow(starttime, endtime)
print "bisAiringLiveNow=" + str(bisAiringLiveNow)
if(bisAiringLiveNow):
- liz.addContextMenuItems([(__language__(21020),
'XBMC.RunScript(' + scriptToRun + ', ' + actionWatchNow + ')'),
(__language__(21019), 'XBMC.RunScript(' + scriptToRun + ', ' + actionRecord +
')')], True)
- else:
- liz.addContextMenuItems([(__language__(21019),
'XBMC.RunScript(' + scriptToRun + ', ' + actionRecord + ')')], True)
+ contextMenuItems.append((__language__(21020),
'XBMC.RunScript(' + scriptToRun + ', ' + actionWatchNow + ')'))
+
+ contextMenuItems.append((__language__(21019), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionRecord + ')'))
+ contextMenuItems.append((__language__(21030), 'XBMC.RunScript(' +
scriptToRun + ', ' + actionAddFavorite + ')'))
+ liz.addContextMenuItems(contextMenuItems, True)
+
liz.setInfo( type="Video", infoLabels={ "Title": name, "Plot": plot,
"Genre": genre, "date": airingdate, "premiered": originalairingdate, "aired":
originalairingdate, "TVShowTitle": showtitle, "season": seasonnum, "episode":
episodenum, "studio": studio } )
liz.setIconImage(iconimage)
liz.setThumbnailImage(iconimage)
@@ -553,7 +620,7 @@ def addTopLevelDir(name,url,mode,iconimage,dirdescription):
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
return ok
-def addDir(name,url,mode,iconimage,thumbimage,showexternalid,airingdate):
+def
addDir(name,url,mode,iconimage,thumbimage,showexternalid,airingdate,fanartimage):
u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
ok=True
liz=xbmcgui.ListItem(name)
@@ -566,6 +633,7 @@ def
addDir(name,url,mode,iconimage,thumbimage,showexternalid,airingdate):
liz.setThumbnailImage(thumbimage)
else:
liz.setThumbnailImage(iconimage)
+ liz.setProperty("fanart_image",fanartimage)
ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
return ok
diff --git a/plugin.video.sagetv/extras/sagex/services/xbmc.js
b/plugin.video.sagetv/extras/sagex/services/xbmc.js
index 61e71e2..d6bbdd0 100644
--- a/plugin.video.sagetv/extras/sagex/services/xbmc.js
+++ b/plugin.video.sagetv/extras/sagex/services/xbmc.js
@@ -59,6 +59,7 @@ function
GetMediaFilesForShowWithSubsetOfProperties(showtitle) {
show.put('WatchedDuration', AiringAPI.GetWatchedDuration(mf));
show.put('IsWatched', AiringAPI.IsWatched(mf));
show.put('FileDuration', MediaFileAPI.GetFileDuration(mf));
+ show.put('IsLibraryFile', MediaFileAPI.IsLibraryFile(mf));
shows.add(show);
}
return shows;
@@ -92,6 +93,7 @@ function SearchForMediaFiles(searchterm) {
show.put('WatchedDuration', AiringAPI.GetWatchedDuration(mf));
show.put('IsWatched', AiringAPI.IsWatched(mf));
show.put('FileDuration', MediaFileAPI.GetFileDuration(mf));
+ show.put('IsLibraryFile', MediaFileAPI.IsLibraryFile(mf));
shows.add(show);
}
}
@@ -112,4 +114,15 @@ function GetTVMediaFilesGroupedByTitle() {
}
}
return grouped;
-}
\ No newline at end of file
+}
+
+function GetPlaylistOfSegmentsForMediafile(mediafileID,sage_rec,sage_unc) {
+ var mf = MediaFileAPI.GetMediaFileForID(mediafileID);
+ if (mf == "" || sage_rec == "" || sage_unc == "") return "";
+ var segs = MediaFileAPI.GetSegmentFiles(mf);
+ ret = "#EXTM3U\n";
+ for (var i=0;i<segs.length;i++) {
+ ret = ret + segs[i].getAbsolutePath().replace(sage_rec,sage_unc) +
"\n";
+ }
+ return ret;
+}
diff --git a/plugin.video.sagetv/resources/language/English/strings.xml
b/plugin.video.sagetv/resources/language/English/strings.xml
index 30cd0bf..fa8dad1 100644
--- a/plugin.video.sagetv/resources/language/English/strings.xml
+++ b/plugin.video.sagetv/resources/language/English/strings.xml
@@ -1,35 +1,55 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<strings>
- <!-- Addon Settings-->
- <string id="20000">SageTV Server Address</string>
- <string id="20001">SageTV Webserver Port</string>
- <string id="20002">SageTV Webserver Username</string>
- <string id="20003">SageTV Webserver Password</string>
- <string id="20004">SageTV Recording Folder</string>
- <string id="20005">SageTV Recording Folder Network path</string>
- <string id="20006">SageTV Server MAC Address (for WOL)</string>
- <!-- Settings-->
-
- <string id="21000">SageTV Server Not Found</string>
- <string id="21001">Unable to connect to your SageTV server.</string>
- <string id="21002">1) Please confirm it is running.</string>
- <string id="21003">2. Confirm the settings of this addon are
correct.</string>
- <string id="21004">Dependency Missing</string>
- <string id="21005">This addon requires sagex-api-services version</string>
- <string id="21006">You do not have the sagex-api plugin installed</string>
- <string id="21007">Please install sagex-api-services to enable this
plugin.</string>
- <string id="21008">You have version</string>
- <string id="21009">Please install/upgrade your sagex-api-services version
to</string>
- <string id="21010">Search</string>
- <string id="21011">SageTV addon</string>
- <string id="21012">Delete successful</string>
- <string id="21013">Scheduled recording successful</string>
- <string id="21014">Attemping to playback live T</string>
- <string id="21015">Unable to playback live TV</string>
- <string id="21016">Delete Show</string>
- <string id="21017">Cancel Recording</string>
- <string id="21018">Remove Favorite</string>
- <string id="21019">Record</string>
- <string id="21020">Watch Now</string>
- <string id="21021">Playback failed; filesize not big enough for
playback</string>
-</strings>
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<strings>
+ <!-- Addon Settings-->
+ <string id="20000">SageTV Server Address</string>
+ <string id="20001">SageTV Webserver Port</string>
+ <string id="20002">SageTV Webserver Username</string>
+ <string id="20003">SageTV Webserver Password</string>
+ <string id="20004">SageTV Recording Folder</string>
+ <string id="20005">SageTV Recording Folder Network path</string>
+ <string id="20006">SageTV Server MAC Address (for WOL)</string>
+ <!-- Settings-->
+
+ <string id="21000">SageTV Server Not Found</string>
+ <string id="21001">Unable to connect to your SageTV server.</string>
+ <string id="21002">1) Please confirm it is running.</string>
+ <string id="21003">2. Confirm the settings of this addon are
correct.</string>
+ <string id="21004">Dependency Missing</string>
+ <string id="21005">This addon requires sagex-api-services version</string>
+ <string id="21006">You do not have the sagex-api-services plugin
installed</string>
+ <string id="21007">Please install sagex-api-services to enable this
plugin.</string>
+ <string id="21008">You have version</string>
+ <string id="21009">Please install/upgrade your sagex-api-services version
to</string>
+ <string id="21010">Search</string>
+ <string id="21011">SageTV addon</string>
+ <string id="21012">Delete successful</string>
+ <string id="21013">Scheduled recording</string>
+ <string id="21014">Attemping to playback live T</string>
+ <string id="21015">Unable to playback live TV</string>
+ <string id="21016">Delete</string>
+ <string id="21017">Cancel Recording</string>
+ <string id="21018">Remove Favorite</string>
+ <string id="21019">Record</string>
+ <string id="21020">Watch Now</string>
+ <string id="21021">Playback failed; filesize not big enough for
playback</string>
+ <string id="21022">Set Watched</string>
+ <string id="21023">Clear Watched</string>
+ <string id="21024">Set Archived</string>
+ <string id="21025">Clear Archived</string>
+ <string id="21026">Delete & Set Watched</string>
+ <string id="21027">Delete & Clear Watched</string>
+ <string id="21028">Delete & Set Don't Like</string>
+ <string id="21029">Delete / Wrong Recording</string>
+ <string id="21030">Add Favorite</string>
+ <string id="21031">Added favorite</string>
+ <string id="21032">Removed favorite</string>
+ <string id="21033">Set watched flag</string>
+ <string id="21034">Cleared watched flag</string>
+ <string id="21035">Set archived flag</string>
+ <string id="21036">Cleared archived flag</string>
+ <string id="21037">Watch (Streamed)</string>
+ <string id="21038">This addon requires media streaming services
version</string>
+ <string id="21039">You do not have the media streaming services plugin
installed</string>
+ <string id="21040">Please install media streaming services to enable
watching streams.</string>
+ <string id="21041">Please install/upgrade your media streaming services
plugin version to</string>
+</strings>
-----------------------------------------------------------------------
Summary of changes:
.gitignore | 4 +-
plugin.video.borsentv.dk/addon.py | 15 +--
plugin.video.borsentv.dk/addon.xml | 2 +-
plugin.video.borsentv.dk/changelog.txt | 3 +
plugin.video.borsentv.dk/fanart.jpg | Bin 0 -> 29002 bytes
plugin.video.borsentv.dk/icon.png | Bin 10242 -> 14971 bytes
.../resources/language/Danish/strings.xml | 11 +-
.../resources/language/English/strings.xml | 11 +-
plugin.video.sagetv/addon.xml | 2 +-
plugin.video.sagetv/changelog.txt | 29 ++++-
plugin.video.sagetv/contextmenuactions.py | 93 +++++++++++++-
plugin.video.sagetv/default.py | 130 +++++++++++++++-----
plugin.video.sagetv/extras/sagex/services/xbmc.js | 15 ++-
.../resources/language/English/strings.xml | 90 ++++++++------
14 files changed, 307 insertions(+), 98 deletions(-)
create mode 100644 plugin.video.borsentv.dk/fanart.jpg
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons