From 5fa7387e99e2938ff1dd279a844627624342560d Mon Sep 17 00:00:00 2001 From: shaun Date: Sat, 13 Jun 2015 11:20:40 +1000 Subject: [PATCH] with direct paths make sure a path was returned --- resources/lib/WriteKodiVideoDB.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/resources/lib/WriteKodiVideoDB.py b/resources/lib/WriteKodiVideoDB.py index e43d8686..a980ce22 100644 --- a/resources/lib/WriteKodiVideoDB.py +++ b/resources/lib/WriteKodiVideoDB.py @@ -615,20 +615,16 @@ class WriteKodiVideoDB(): #### ADD OR UPDATE THE FILE AND PATH ########### #### NOTE THAT LASTPLAYED AND PLAYCOUNT ARE STORED AT THE FILE ENTRY - if addon.getSetting('useDirectPaths')=='true': - if True: #PlayUtils().isDirectPlay(MBitem): # dont do the exists check - playurl = PlayUtils().directPlay(MBitem) - #use the direct file path - if "\\" in playurl: - filename = playurl.rsplit("\\",1)[-1] - path = playurl.replace(filename,"") - elif "/" in playurl: - filename = playurl.rsplit("/",1)[-1] - path = playurl.replace(filename,"") - else: - #for transcoding we just use the server's streaming path because I couldn't figure out how to set the plugin path in the music DB - path = server + "/Video/%s/" %MBitem["Id"] - filename = "stream.mp4" + if addon.getSetting('useDirectPaths') == 'true': + playurl = PlayUtils().directPlay(MBitem) + if playurl == False: + return + elif "\\" in playurl: + filename = playurl.rsplit("\\",1)[-1] + path = playurl.replace(filename, "") + elif "/" in playurl: + filename = playurl.rsplit("/",1)[-1] + path = playurl.replace(filename, "") else: path = "plugin://plugin.video.emby/tvshows/" + MBitem["SeriesId"] + "/" filename = "plugin://plugin.video.emby/tvshows/" + MBitem["SeriesId"] + "/?id=" + MBitem["Id"] + "&mode=play"