Add control over notification time for new content

Video and music library
This commit is contained in:
angelblue05 2016-02-04 05:42:17 -06:00
parent 4df6bb68d3
commit c2dace4c1e
3 changed files with 12 additions and 9 deletions

View file

@ -233,11 +233,7 @@
<string id="30241">DB Sync Indication:</string> <string id="30241">DB Sync Indication:</string>
<string id="30242">Play Count Sync Indication:</string> <string id="30242">Play Count Sync Indication:</string>
<string id="30243">Enable HTTPS</string><!-- Verified --> <string id="30243">Enable HTTPS</string><!-- Verified -->
<string id="30245">Force Transcoding Codecs</string>
<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 startup</string><!-- Verified --> <string id="30249">Enable server connection message on startup</string><!-- Verified -->
<string id="30251">Recently added Home Videos</string> <string id="30251">Recently added Home Videos</string>
@ -309,6 +305,8 @@
<string id="30529">Startup delay (in seconds)</string> <string id="30529">Startup delay (in seconds)</string>
<string id="30530">Enable server restart message</string> <string id="30530">Enable server restart message</string>
<string id="30531">Enable new content notification</string> <string id="30531">Enable new content notification</string>
<string id="30532">For the video library (in seconds)</string>
<string id="30533">For the music library (in seconds)</string>
<!-- service add-on --> <!-- service add-on -->
<string id="33000">Welcome</string> <string id="33000">Welcome</string>

View file

@ -39,6 +39,8 @@ class Items(object):
self.directpath = utils.settings('useDirectPaths') == "1" self.directpath = utils.settings('useDirectPaths') == "1"
self.music_enabled = utils.settings('enableMusic') == "true" self.music_enabled = utils.settings('enableMusic') == "true"
self.contentmsg = utils.settings('newContent') == "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.artwork = artwork.Artwork()
self.emby = embyserver.Read_EmbyServer() self.emby = embyserver.Read_EmbyServer()
@ -205,11 +207,12 @@ class Items(object):
return True return True
def contentPop(self, name): def contentPop(self, name, time=5000):
xbmcgui.Dialog().notification( xbmcgui.Dialog().notification(
heading="Emby for Kodi", heading="Emby for Kodi",
message="Added: %s" % name, message="Added: %s" % name,
icon="special://home/addons/plugin.video.emby/icon.png", icon="special://home/addons/plugin.video.emby/icon.png",
time=time,
sound=False) sound=False)
@ -232,7 +235,7 @@ class Movies(Items):
count += 1 count += 1
self.add_update(movie) self.add_update(movie)
if not pdialog and self.contentmsg: if not pdialog and self.contentmsg:
self.contentPop(title) self.contentPop(title, self.newvideo_time)
def added_boxset(self, items, pdialog): def added_boxset(self, items, pdialog):
@ -627,7 +630,7 @@ class MusicVideos(Items):
count += 1 count += 1
self.add_update(mvideo) self.add_update(mvideo)
if not pdialog and self.contentmsg: if not pdialog and self.contentmsg:
self.contentPop(title) self.contentPop(title, self.newvideo_time)
def add_update(self, item, viewtag=None, viewid=None): def add_update(self, item, viewtag=None, viewid=None):
@ -964,7 +967,7 @@ class TVShows(Items):
count += 1 count += 1
self.add_updateEpisode(episode) self.add_updateEpisode(episode)
if not pdialog and self.contentmsg: if not pdialog and self.contentmsg:
self.contentPop(title) self.contentPop(title, self.newvideo_time)
def add_update(self, item, viewtag=None, viewid=None): def add_update(self, item, viewtag=None, viewid=None):
@ -1665,7 +1668,7 @@ class Music(Items):
count += 1 count += 1
self.add_updateSong(song) self.add_updateSong(song)
if not pdialog and self.contentmsg: if not pdialog and self.contentmsg:
self.contentPop(title) self.contentPop(title, self.newmusic_time)
def add_updateArtist(self, item, artisttype="MusicArtist"): def add_updateArtist(self, item, artisttype="MusicArtist"):
# Process a single artist # Process a single artist

View file

@ -68,6 +68,8 @@
<setting id="connectMsg" type="bool" label="30249" default="true" /> <setting id="connectMsg" type="bool" label="30249" default="true" />
<setting id="restartMsg" type="bool" label="30530" default="false" /> <setting id="restartMsg" type="bool" label="30530" default="false" />
<setting id="newContent" type="bool" label="30531" 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>
<category label="30022"><!-- Advanced --> <category label="30022"><!-- Advanced -->