mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 04:06:11 +00:00
use the plugin method for playback when transcoding, use native kodi playback for direct access
This commit is contained in:
parent
7493e57fcb
commit
03d99ed0d8
4 changed files with 23 additions and 26 deletions
|
@ -64,6 +64,10 @@ class CreateFiles():
|
|||
server = host + ":" + port
|
||||
playurl = PlayUtils().getPlayUrl(server, item["Id"], item)
|
||||
|
||||
#do not use direct path for transcoding
|
||||
if playurl.startswith("http"):
|
||||
playurl = "plugin://plugin.video.emby/?id=" + item["Id"] + '&mode=play'
|
||||
|
||||
text_file.writelines(playurl)
|
||||
text_file.close()
|
||||
|
||||
|
|
|
@ -76,9 +76,10 @@ class PlayUtils():
|
|||
|
||||
# Works out if we are direct playing or not
|
||||
def isDirectPlay(self, result):
|
||||
if (self.fileExists(result) or (result.get("LocationType") == "FileSystem" and self.isNetworkQualitySufficient(result) == True and self.isLocalPath(result) == False)):
|
||||
return True
|
||||
else:
|
||||
# if (self.fileExists(result) or (result.get("LocationType") == "FileSystem" and self.isNetworkQualitySufficient(result) == True and self.isLocalPath(result) == False)):
|
||||
# return True
|
||||
# else:
|
||||
# return False
|
||||
return False
|
||||
|
||||
|
||||
|
|
|
@ -99,6 +99,8 @@ class WriteKodiDB():
|
|||
|
||||
#set Filename
|
||||
playurl = PlayUtils().getPlayUrl(server, MBitem["Id"], MBitem)
|
||||
if playurl.startswith("http"):
|
||||
playurl = "plugin://plugin.video.emby/?id=" + MBitem["Id"] + '&mode=play'
|
||||
if playurl != KodiItem["file"]:
|
||||
self.setKodiFilename(KodiItem["movieid"], playurl, "movie")
|
||||
|
||||
|
@ -432,6 +434,8 @@ class WriteKodiDB():
|
|||
|
||||
#set Filename
|
||||
playurl = PlayUtils().getPlayUrl(server, MBitem["Id"], MBitem)
|
||||
if playurl.startswith("http"):
|
||||
playurl = "plugin://plugin.video.emby/?id=" + MBitem["Id"] + '&mode=play'
|
||||
if playurl != KodiItem["file"]:
|
||||
self.setKodiFilename(KodiItem["episodeid"], playurl, "episode")
|
||||
|
||||
|
@ -890,27 +894,15 @@ class WriteKodiDB():
|
|||
def setKodiFilename(self, id, filenameAndPath, fileType):
|
||||
#use sqlite to set the filename in DB -- needed to avoid problems with resumepoints etc
|
||||
#todo --> submit PR to kodi team to get this added to the jsonrpc api
|
||||
|
||||
#todo --> extend support for musicvideos
|
||||
filenameAndPath = utils.convertEncoding(filenameAndPath)
|
||||
|
||||
print "set filepath for id " + str(id)
|
||||
|
||||
if not filenameAndPath.startswith("http"):
|
||||
#assume direct play
|
||||
if "\\" in filenameAndPath:
|
||||
filename = filenameAndPath.rsplit("\\",1)[-1]
|
||||
path = filenameAndPath.replace(filename,"")
|
||||
elif "/" in filenameAndPath:
|
||||
filename = filenameAndPath.rsplit("/",1)[-1]
|
||||
path = filenameAndPath.replace(filename,"")
|
||||
else:
|
||||
#assume play from stream ?
|
||||
filename = filenameAndPath
|
||||
path = "plugin://plugin.video.emby/"
|
||||
else:
|
||||
#assume play from stream
|
||||
filename = filenameAndPath
|
||||
path = "plugin://plugin.video.emby/"
|
||||
|
||||
utils.logMsg("MB3 Sync","setting filename in kodi db..." + fileType + ": " + str(id))
|
||||
xbmc.sleep(sleepVal)
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
</category>
|
||||
|
||||
<category label="Playback"> <!-- Extra Sync options -->
|
||||
<setting id="addExtraPlaybackArt" type="bool" label="Add extra playback art" default="true" visible="true" enable="true" />
|
||||
<setting id="addExtraPlaybackArt" type="bool" label="Add extra playback art" default="true" visible="false" enable="true" />
|
||||
<setting id="smbusername" type="text" label="30007" default="" visible="true" enable="true" />
|
||||
<setting id="smbpassword" type="text" label="30008" default="" option="hidden" visible="true" enable="true" />
|
||||
</category>
|
||||
|
|
Loading…
Reference in a new issue