Merge remote-tracking branch 'MediaBrowser/master' into develop

This commit is contained in:
tomkat83 2016-02-04 13:08:57 +01:00
commit 5aa88bdca8
8 changed files with 143 additions and 99 deletions

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<strings>
<string id="30000">Primary Server Address</string>
<string id="30001">Auto enter single folder items:</string>
<string id="30002">Play from HTTP instead of SMB:</string>
<string id="30004">Log Level:</string>
<!-- Add-on settings -->
<string id="30000">Primary Server Address</string><!-- Verified -->
<string id="30002">Play from HTTP instead of SMB</string><!-- Verified -->
<string id="30004">Log level</string><!-- Verified -->
<string id="30005">Username: </string>
<string id="30006">Password: </string>
<string id="30007">Network Username: </string>
@ -17,11 +17,10 @@
<string id="30016">Device Name</string>
<string id="30022">Advanced</string>
<string id="30024">Username:</string>
<string id="30025">Password:</string>
<string id="30024">Username</string><!-- Verified -->
<string id="30026">Use SIMPLEJSON instead of JSON</string>
<string id="30030">Port Number:</string>
<string id="30030">Port Number</string><!-- Verified -->
<string id="30036">Number of recent Movies to show:</string>
<string id="30037">Number of recent TV episodes to show:</string>
<string id="30035">Number of recent Music Albums to show:</string>
@ -97,9 +96,9 @@
<string id="30111">Include Stream Info</string>
<string id="30112">Include People</string>
<string id="30113">Include Overview</string>
<string id="30114">Offer delete after playback</string>
<string id="30115">For Episodes</string>
<string id="30116">For Movies</string>
<string id="30114">Offer delete after playback</string><!-- Verified -->
<string id="30115">For Episodes</string><!-- Verified -->
<string id="30116">For Movies</string><!-- Verified -->
<string id="30117">Background Art Refresh Rate (seconds)</string>
<string id="30118">Add Resume Percent</string>
<string id="30119">Add Episode Number</string>
@ -143,10 +142,10 @@
<string id="30154"> - Show Unplayed Count Indicator</string>
<string id="30155"> - Show Played Percentage Indicator</string>
<string id="30156">Sort NextUp by Show Title</string>
<string id="30157">Enable Enhanced Images (eg CoverArt)</string>
<string id="30157">Enable Enhanced Images (eg CoverArt)</string><!-- Verified -->
<string id="30158">Metadata</string>
<string id="30159">Artwork</string>
<string id="30160">Video Quality</string>
<string id="30160">Video Quality</string><!-- Verified -->
<string id="30161">Enable Suggested Loader (Requires Restart)</string>
<string id="30162">Add Season Number</string>
@ -224,23 +223,18 @@
<string id="30229">Random Items</string>
<string id="30230">Recommended Items</string>
<string id="30235">Extras</string>
<string id="30235">Extras</string><!-- Verified -->
<string id="30236">Sync Theme Music</string>
<string id="30237">Sync Extra Fanart</string>
<string id="30238">Sync Movie BoxSets</string>
<string id="30239">Reset Local Kodi DB</string>
<string id="30239">Reset local Kodi database</string><!-- Verified -->
<string id="30240">Enable watched/resume status sync</string>
<string id="30241">DB Sync Indication:</string>
<string id="30242">Play Count Sync Indication:</string>
<string id="30243">Enable HTTPS</string>
<string id="30245">Force Transcoding Codecs</string>
<string id="30243">Enable HTTPS</string><!-- Verified -->
<string id="30246">Enable Netflix style next up notification</string>
<string id="30247"> - The number of seconds before the end to show the notification</string>
<string id="30248">Show Emby Info dialog on play/select action</string>
<string id="30249">Enable server connection message on start-up</string>
<string id="30250">Use local paths instead of addon redirect for playback</string>
<string id="30249">Enable server connection message on startup</string><!-- Verified -->
<string id="30251">Recently added Home Videos</string>
<string id="30252">Recently added Photos</string>
@ -278,6 +272,42 @@
<string id="30408">Emby addon settings</string>
<string id="30409">Delete item from the server</string>
<!-- add-on settings -->
<string id="30500">Verify Host SSL Certificate</string>
<string id="30501">Client SSL certificate</string>
<string id="30502">Use alternate address</string>
<string id="30503">Alternate Server Address</string>
<string id="30504">Use altername device Name</string>
<string id="30505">[COLOR yellow]Retry login[/COLOR]</string>
<string id="30506">Sync Options</string>
<string id="30507">Show syncing progress</string>
<string id="30508">Sync empty TV Shows</string>
<string id="30509">Enable Music Library</string>
<string id="30510">Direct stream music library</string>
<string id="30511">Playback Mode</string>
<string id="30512">Force artwork caching</string>
<string id="30513">Limit artwork cache threads</string>
<string id="30514">Enable fast startup (requires server plugin)</string>
<string id="30515">Maximum items to request from the server at once</string>
<string id="30516">Playback</string>
<string id="30517">Network credentials</string>
<string id="30518">Enable Emby cinema mode</string>
<string id="30519">Ask to play trailers</string>
<string id="30520">Skip delete confirmation</string>
<string id="30521">Jump back on resume (in seconds)</string>
<string id="30522">Force transcode H265</string>
<string id="30523">Music metadata options (not compatible with direct stream)</string>
<string id="30524">Import music song rating directly from files</string>
<string id="30525">Convert music song rating to Emby rating</string>
<string id="30526">Allow rating in song files to be updated</string>
<string id="30527">Ignore specials in next episodes</string>
<string id="30528">Permanent users to add to the session</string>
<string id="30529">Startup delay (in seconds)</string>
<string id="30530">Enable server restart message</string>
<string id="30531">Enable new content notification</string>
<string id="30532">Duration for the video library (in seconds)</string>
<string id="30533">Duration for the music library (in seconds)</string>
<!-- service add-on -->
<string id="33000">Welcome</string>
<string id="33001">Error connecting</string>

View file

@ -37,6 +37,8 @@ class Items(object):
self.directpath = utils.settings('useDirectPaths') == "1"
self.music_enabled = utils.settings('enableMusic') == "true"
self.contentmsg = utils.settings('newContent') == "true"
self.newvideo_time = int(utils.settings('newvideotime'))*1000
self.newmusic_time = int(utils.settings('newmusictime'))*1000
self.artwork = artwork.Artwork()
self.emby = embyserver.Read_EmbyServer()
@ -217,11 +219,12 @@ class Items(object):
return True
def contentPop(self, name):
def contentPop(self, name, time=5000):
xbmcgui.Dialog().notification(
heading="Emby for Kodi",
message="Added: %s" % name,
icon="special://home/addons/plugin.video.plexkodiconnect/icon.png",
time=time,
sound=False)
def updateUserdata(self, xml):
@ -260,7 +263,7 @@ class Movies(Items):
count += 1
self.add_update(movie)
if not pdialog and self.contentmsg:
self.contentPop(title)
self.contentPop(title, self.newvideo_time)
def added_boxset(self, items, pdialog):
@ -551,7 +554,7 @@ class MusicVideos(Items):
count += 1
self.add_update(mvideo)
if not pdialog and self.contentmsg:
self.contentPop(title)
self.contentPop(title, self.newvideo_time)
def add_update(self, item, viewtag=None, viewid=None):
@ -884,7 +887,7 @@ class TVShows(Items):
count += 1
self.add_updateEpisode(episode)
if not pdialog and self.contentmsg:
self.contentPop(title)
self.contentPop(title, self.newvideo_time)
def add_update(self, item, viewtag=None, viewid=None):
# Process single tvshow
@ -1539,7 +1542,7 @@ class Music(Items):
count += 1
self.add_updateSong(song)
if not pdialog and self.contentmsg:
self.contentPop(title)
self.contentPop(title, self.newmusic_time)
def add_updateArtist(self, item, artisttype="MusicArtist"):
# Process a single artist

View file

@ -197,5 +197,4 @@ class KodiMonitor(xbmc.Monitor):
utils.window('emby_onWake', value="true")
elif method == "Playlist.OnClear":
utils.window('emby_customPlaylist', clear=True)
self.logMsg("Clear playlist properties.")
pass

View file

@ -1592,10 +1592,10 @@ class ManualSync(LibrarySync):
# Only update if songs is not in Kodi or checksum is different
updatelist.append(itemid)
self.logMsg("%s to update: %s" % (type, updatelist), 1)
embyitems = emby.getFullItems(updatelist)
total = len(updatelist)
del updatelist[:]
self.logMsg("%s to update: %s" % (type, updatelist), 1)
embyitems = emby.getFullItems(updatelist)
total = len(updatelist)
del updatelist[:]
if pdialog:
pdialog.update(heading="Processing %s / %s items" % (type, total))

View file

@ -93,6 +93,15 @@ class Player(xbmc.Player):
itemType = utils.window("%s.type" % embyitem)
utils.window('emby_skipWatched%s' % itemId, value="true")
if (utils.window('emby_customPlaylist') == "true" and
utils.window('emby_customPlaylist.seektime')):
# Start at, when using custom playlist (play to Kodi from webclient)
seektime = utils.window('emby_customPlaylist.seektime')
self.logMsg("Seeking to: %s" % seektime, 1)
xbmcplayer.seekTime(int(seektime)/10000000.0)
utils.window('emby_customPlaylist.seektime', clear=True)
seekTime = xbmcplayer.getTime()
# Get playback volume
@ -410,6 +419,7 @@ class Player(xbmc.Player):
# Will be called when user stops xbmc playing a file
self.logMsg("ONPLAYBACK_STOPPED", 2)
utils.window('emby_customPlaylist', clear=True)
utils.window('emby_customPlaylist.seektime', clear=True)
utils.window('emby_playbackProps', clear=True)
self.logMsg("Clear playlist properties.", 1)
self.stopAll()
@ -417,6 +427,7 @@ class Player(xbmc.Player):
def onPlayBackEnded( self ):
# Will be called when xbmc stops playing a file
self.logMsg("ONPLAYBACK_ENDED", 2)
utils.window('emby_customPlaylist.seektime', clear=True)
self.stopAll()
def stopAll(self):

View file

@ -31,17 +31,19 @@ class Playlist():
embycursor = embyconn.cursor()
emby_db = embydb.Embydb_Functions(embycursor)
self.logMsg("---*** PLAY ALL ***---", 1)
self.logMsg("Items: %s and start at: %s" % (itemids, startat))
player = xbmc.Player()
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
playlist.clear()
started = False
self.logMsg("---*** PLAY ALL ***---", 1)
self.logMsg("Items: %s and start at: %s" % (itemids, startat))
started = False
utils.window('emby_customplaylist', value="true")
position = 0
if startat != 0:
# Seek to the starting position
utils.window('emby_customplaylist.seektime', str(startat))
for itemid in itemids:
embydb_item = emby_db.getItem_byId(itemid)
@ -63,12 +65,6 @@ class Playlist():
started = True
player.play(playlist)
if startat:
# Seek to the starting position
seektime = startat / 10000000.0
player.seekTime(seektime)
self.logMsg("Seeking to: %s" % seektime, 1)
self.verifyPlaylist()
embycursor.close()

View file

@ -468,20 +468,21 @@ def sourcesXML():
etree.SubElement(video, 'default', attrib={'pathversion': "1"})
# Add elements
for i in range(1, 3):
for source in root.findall('.//path'):
if source.text == "smb://embydummy/dummypath%s/" % i:
# Already there, skip
break
else:
source = etree.SubElement(video, 'source')
etree.SubElement(source, 'name').text = "Emby"
etree.SubElement(source, 'path', attrib={'pathversion': "1"}).text = (
"smb://embydummy/dummypath%s/" % i
)
etree.SubElement(source, 'allowsharing').text = "true"
count = 2
for source in root.findall('.//path'):
if source.text == "smb://":
count -= 1
if count == 0:
# sources already set
break
else:
# Missing smb:// occurences, re-add.
for i in range(0, count):
source = etree.SubElement(video, 'source')
etree.SubElement(source, 'name').text = "Emby"
etree.SubElement(source, 'path', attrib={'pathversion': "1"}).text = "smb://"
etree.SubElement(source, 'allowsharing').text = "true"
# Prettify and write to file
try:
indent(root)

View file

@ -5,20 +5,20 @@
<setting id="ipaddress" label="30000" type="text" default="" />
<setting id="port" label="30030" type="number" default="32400" />
<setting id="https" label="30243" type="bool" default="false" />
<setting id="sslverify" subsetting="true" label="Verify Host SSL Certificate" type="bool" default="true" visible="eq(-1,true)" />
<setting id="sslcert" subsetting="true" label="Client SSL certificate" type="file" default="None" visible="eq(-2,true)" />
<setting id="sslverify" subsetting="true" label="30500" type="bool" default="false" visible="eq(-1,true)" />
<setting id="sslcert" subsetting="true" label="30501" type="file" default="None" visible="eq(-2,true)" />
<!-- Secondary address -->
<setting id="altip" label="Use alternate address" type="bool" default="false" />
<setting id="secondipaddress" label="Secondary Server Address" type="text" default="" visible="eq(-1,true)" />
<setting id="secondport" label="30030" type="number" default="32400" visible="eq(-2,true)" />true)" />
<setting id="secondhttps" label="30243" type="bool" default="false" visible="eq(-3,true)" />
<setting id="secondsslverify" subsetting="true" label="Verify Host SSL Certificate" type="bool" default="true" visible="eq(-1,true)" />
<setting id="secondsslcert" subsetting="true" label="Client SSL certificate" type="file" default="None" visible="eq(-2,true)" />
<setting id="altip" label="30502" type="bool" default="false" />
<setting id="secondipaddress" subsetting="true" label="30503" type="text" default="" visible="eq(-1,true)" />
<setting id="secondport" subsetting="true" label="30030" type="number" default="8096" visible="eq(-2,true)" />
<setting id="secondhttps" subsetting="true" label="30243" type="bool" default="false" visible="eq(-3,true)" />
<setting id="secondsslverify" subsetting="true" label="30500" type="bool" default="false" visible="eq(-1,true)" />
<setting id="secondsslcert" subsetting="true" label="30501" type="file" default="None" visible="eq(-2,true)" />
<!-- User settings -->
<setting type="sep" />
<setting id="deviceNameOpt" label="Change device name (friendly name)" type="bool" default="false" />
<setting id="deviceNameOpt" label="30504" type="bool" default="false" />
<setting id="deviceName" label="30016" type="text" visible="eq(-1,true)" default="Kodi" />
<setting label="[COLOR yellow]Reset login attempts[/COLOR]" type="action" visible="eq(1,) + !eq(-15,)" action="RunPlugin(plugin://plugin.video.plexkodiconnect?mode=resetauth)" option="close" />
<setting label="30505" type="action" visible="eq(1,) + !eq(-15,)" action="RunPlugin(plugin://plugin.video.plexkodiconnect?mode=resetauth)" option="close" />
<setting id="accessToken" type="text" visible="false" default="" />
<setting id="pathsub" type="bool" visible="false" default="false" />
</category>
@ -29,56 +29,60 @@
<setting id="plexLogin" label="plex.tv username" type="text" default="" visible="eq(-1,true)" />
<setting id="plexhome" label="Plex home in use" type="bool" default="true" visible="false" />
<setting id="plexToken" label="plexToken" type="text" default="" visible="false" />
<category label="30506"><!-- Sync Options -->
<setting id="serverSync" type="bool" label="30514" default="true" />
<setting id="dbSyncIndicator" label="30507" type="bool" default="false" />
<setting type="sep" />
<setting id="limitindex" type="number" label="30515" default="200" option="int" />
<setting id="enableTextureCache" label="30512" type="bool" default="true" />
<setting id="imageCacheLimit" type="enum" label="30513" values="Disabled|5|10|15|20|25" default="0" visible="eq(-1,true)" subsetting="true" />
<setting id="syncEmptyShows" type="bool" label="30508" default="false" />
<setting id="useDirectPaths" type="enum" label="30511" values="Addon(Default)|Native(Direct paths)" default="0" />
<setting id="enableMusic" type="bool" label="30509" default="true" />
<setting id="streamMusic" type="bool" label="30510" default="false" visible="eq(-1,true)" subsetting="true" />
<setting type="lsep" label="30523" />
<setting id="enableImportSongRating" type="bool" label="30524" default="true" />
<setting id="enableExportSongRating" type="bool" label="30525" default="false" />
<setting id="enableUpdateSongRating" type="bool" label="30526" default="false" />
</category>
<category label="Sync Options">
<setting id="dbSyncIndicator" label="Show sync progress" type="bool" default="false" />
<setting id="syncEmptyShows" type="bool" label="Sync empty TV Shows" default="false" />
<setting id="enableMusic" type="bool" label="Enable Music Library Sync" default="true" />
<setting id="streamMusic" type="bool" label="Direct stream music library" default="false" visible="eq(-1,true)" subsetting="true" />
<setting id="useDirectPaths" type="enum" label="Playback Mode" values="Addon(Default)|Native(Direct paths)" default="0" />
<setting id="enableTextureCache" label="Auto add images to the Kodi texture cache" type="bool" default="true" />
<setting id="imageCacheLimit" type="enum" label="Limit image cache import threads" values="None|5|10|15|20|25" default="0" visible="eq(-1,true)"/>
<setting id="serverSync" type="bool" label="Enable fast starting sync" default="true" />
<setting id="limitindex" type="number" label="Maximum items to request at once from server" default="200" option="int" />
</category>
<category label="Playback"> <!-- Extra Sync options -->
<setting label="Network credentials" type="action" action="RunPlugin(plugin://plugin.video.plexkodiconnect?mode=passwords)" option="close" />
<category label="30516"><!-- Playback -->
<setting label="30517" type="action" action="RunPlugin(plugin://plugin.video.plexkodiconnect?mode=passwords)" option="close" />
<setting type="sep" />
<setting id="enableCinema" type="bool" label="Enable Plex cinema mode" default="true" />
<setting id="trailerNumber" type="number" label="Number of trailers to play before movie" default="3" visible="eq(-1,true)" option="int" />
<setting id="askCinema" type="bool" label="Ask to play trailers" default="false" visible="eq(-2,true)" subsetting="true" />
<setting id="enableCinema" type="bool" label="30518" default="true" />
<setting id="askCinema" type="bool" label="30519" default="false" visible="eq(-1,true)" subsetting="true" />
<setting id="trailerNumber" type="number" label="Number of trailers to play before movie" default="3" visible="eq(-2,true)" option="int" />
<setting id="offerDelete" type="bool" label="30114" default="false" />
<setting id="deleteTV" type="bool" label="30115" visible="eq(-1,true)" default="false" subsetting="true" />
<setting id="deleteMovies" type="bool" label="30116" visible="eq(-2,true)" default="false" subsetting="true" />
<setting id="skipConfirmDelete" type="bool" label="Skip delete confirmation" visible="eq(-3,true)" default="false" subsetting="true" />
<setting id="resumeJumpBack" type="slider" label="On Resume Jump Back Seconds" default="10" range="0,1,120" option="int" />
<setting id="skipConfirmDelete" type="bool" label="30520" visible="eq(-3,true)" default="false" subsetting="true" />
<setting id="resumeJumpBack" type="slider" label="30521" default="10" range="0,1,120" option="int" />
<setting type="sep" />
<setting id="playFromStream" type="bool" label="30002" default="false" />
<setting id="videoBitrate" type="enum" label="30160" values="664 Kbps SD|996 Kbps HD|1.3 Mbps HD|2.0 Mbps HD|3.2 Mbps HD|4.7 Mbps HD|6.2 Mbps HD|7.7 Mbps HD|9.2 Mbps HD|10.7 Mbps HD|12.2 Mbps HD|13.7 Mbps HD|15.2 Mbps HD|16.7 Mbps HD|18.2 Mbps HD|20.0 Mbps HD|40.0 Mbps HD|100.0 Mbps HD [default]|1000.0 Mbps HD" visible="eq(-1,true)" default="17" />
<setting id="transcodeH265" type="bool" label="Force transcode 1080p/H265" default="false" />
<setting id="transcode720H265" type="bool" label="Force transcode 720p/H265" default="false" />
<setting id="transcodeH265" type="enum" label="30522" default="0" values="Disabled|480p(and higher)|720p(and higher)|1080p" />
<setting id="markPlayed" type="number" visible="false" default="90" />
<setting id="failedCount" type="number" visible="false" default="0" />
<setting id="networkCreds" type="text" visible="false" default="" />
</category>
<category label="Extras">
<category label="30235"><!-- Extras -->
<setting id="enableCoverArt" type="bool" label="30157" default="true" />
<setting id="ignoreSpecialsNextEpisodes" type="bool" label="Ignore specials in next episodes" default="false" />
<setting id="additionalUsers" type="text" label="Permanent users to add to the session" default="" />
<setting id="startupDelay" type="number" label="Startup Delay (seconds)" default="0" option="int" />
<setting type="lsep" label="Music metadata options (not possible with directstream)" />
<setting id="enableImportSongRating" type="bool" label="Import Music song rating directly from files" default="true" />
<setting id="enableExportSongRating" type="bool" label="Convert Music song rating to Emby (likes/favourites)" default="false" />
<setting id="enableUpdateSongRating" type="bool" label="Allow rating in song files to be updated by Kodi/Emby" default="false" />
<setting id="ignoreSpecialsNextEpisodes" type="bool" label="30527" default="false" />
<setting id="additionalUsers" type="text" label="30528" default="" />
<setting type="sep" />
<setting id="connectMsg" type="bool" label="30249" default="true" />
<setting id="restartMsg" type="bool" label="30530" default="false" />
<setting id="newContent" type="bool" label="30531" default="false" />
<setting id="newvideotime" type="number" label="30532" visible="eq(-1,true)" default="5" option="int" subsetting="true" />
<setting id="newmusictime" type="number" label="30533" visible="eq(-2,true)" default="2" option="int" subsetting="true" />
</category>
<category label="30022">
<setting id="logLevel" type="enum" label="30004" values="None|Info|Debug" default="2" />
<setting id="connectMsg" type="bool" label="30249" default="true" />
<setting id="restartMsg" type="bool" label="Enable server message when it's restarting" default="false" />
<setting id="newContent" type="bool" label="Enable new content notification" default="false" />
<category label="30022"><!-- Advanced -->
<setting id="logLevel" type="enum" label="30004" values="Disabled|Info|Debug" default="1" />
<setting id="startupDelay" type="number" label="30529" default="0" option="int" />
<setting label="30239" type="action" action="RunPlugin(plugin://plugin.video.plexkodiconnect?mode=reset)" option="close" />
<setting id="syncThreadNumber" type="number" label="Number of parallel threads while syncing" default="10" option="int"/>
</category>