mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 01:36:11 +00:00
added support for 3d format in streamdetails
This commit is contained in:
parent
d69e474f3e
commit
812e3090a5
2 changed files with 16 additions and 13 deletions
|
@ -84,6 +84,7 @@ class API():
|
|||
width = ''
|
||||
aspectratio = '1:1'
|
||||
aspectfloat = 1.85
|
||||
Video3DFormat = ''
|
||||
|
||||
if mediaSources == True:
|
||||
mediaSources = item.get("MediaSources")
|
||||
|
@ -102,6 +103,7 @@ class API():
|
|||
height = int(mediaStream.get("Height"))
|
||||
width = int(mediaStream.get("Width"))
|
||||
aspectratio = mediaStream.get("AspectRatio")
|
||||
Video3DFormat = item.get("Video3DFormat")
|
||||
if aspectratio != None and len(aspectratio) >= 3:
|
||||
try:
|
||||
aspectwidth,aspectheight = aspectratio.split(':')
|
||||
|
@ -116,7 +118,8 @@ class API():
|
|||
'audiocodec' : audiocodec,
|
||||
'height' : height,
|
||||
'width' : width,
|
||||
'aspectratio' : aspectfloat
|
||||
'aspectratio' : aspectfloat,
|
||||
'3dformat' : Video3DFormat
|
||||
}
|
||||
|
||||
def getChecksum(self, item):
|
||||
|
|
|
@ -162,10 +162,7 @@ class WriteKodiDB():
|
|||
#create the reference in emby table
|
||||
pathsql = "INSERT into emby(emby_id, kodi_id, media_type, checksum) values(?, ?, ?, ?)"
|
||||
cursor.execute(pathsql, (MBitem["Id"], movieid, "movie", API().getChecksum(MBitem)))
|
||||
|
||||
#add streamdetails
|
||||
self.AddStreamDetailsToMedia(API().getMediaStreams(MBitem), fileid, cursor)
|
||||
|
||||
|
||||
#### UPDATE THE MOVIE #####
|
||||
else:
|
||||
utils.logMsg("UPDATE movie to Kodi library","Id: %s - Title: %s" % (embyId, title))
|
||||
|
@ -194,6 +191,9 @@ class WriteKodiDB():
|
|||
#update studios
|
||||
self.AddStudiosToMedia(movieid, studios, "movie", cursor)
|
||||
|
||||
#add streamdetails
|
||||
self.AddStreamDetailsToMedia(API().getMediaStreams(MBitem), fileid, cursor)
|
||||
|
||||
#set resume point
|
||||
resume = int(round(float(timeInfo.get("ResumeTime"))))*60
|
||||
total = int(round(float(timeInfo.get("TotalTime"))))*60
|
||||
|
@ -297,9 +297,6 @@ class WriteKodiDB():
|
|||
pathsql = "INSERT into emby(emby_id, kodi_id, media_type, checksum) values(?, ?, ?, ?)"
|
||||
cursor.execute(pathsql, (MBitem["Id"], idMVideo, "musicvideo", API().getChecksum(MBitem)))
|
||||
|
||||
#add streamdetails
|
||||
self.AddStreamDetailsToMedia(API().getMediaStreams(MBitem), fileid, cursor)
|
||||
|
||||
#### UPDATE THE VIDEO #####
|
||||
else:
|
||||
utils.logMsg("UPDATE musicvideo to Kodi library","Id: %s - Title: %s" % (embyId, title))
|
||||
|
@ -328,6 +325,9 @@ class WriteKodiDB():
|
|||
#update studios
|
||||
self.AddStudiosToMedia(idMVideo, studios, "musicvideo", cursor)
|
||||
|
||||
#add streamdetails
|
||||
self.AddStreamDetailsToMedia(API().getMediaStreams(MBitem), fileid, cursor)
|
||||
|
||||
#set resume point
|
||||
resume = int(round(float(timeInfo.get("ResumeTime"))))*60
|
||||
total = int(round(float(timeInfo.get("TotalTime"))))*60
|
||||
|
@ -637,9 +637,6 @@ class WriteKodiDB():
|
|||
#create the reference in emby table
|
||||
pathsql = "INSERT into emby(emby_id, kodi_id, media_type, checksum, parent_id) values(?, ?, ?, ?, ?)"
|
||||
cursor.execute(pathsql, (MBitem["Id"], episodeid, "episode", API().getChecksum(MBitem), showid))
|
||||
|
||||
#add streamdetails
|
||||
self.AddStreamDetailsToMedia(API().getMediaStreams(MBitem), fileid, cursor)
|
||||
|
||||
# UPDATE THE EPISODE IN KODI (for now, we just send in all data)
|
||||
else:
|
||||
|
@ -659,6 +656,9 @@ class WriteKodiDB():
|
|||
total = int(round(float(timeInfo.get("TotalTime"))))*60
|
||||
self.setKodiResumePoint(fileid, resume, total, cursor)
|
||||
|
||||
#add streamdetails
|
||||
self.AddStreamDetailsToMedia(API().getMediaStreams(MBitem), fileid, cursor)
|
||||
|
||||
#update artwork
|
||||
self.addOrUpdateArt(API().getArtwork(MBitem, "Primary"), episodeid, "episode", "thumb", cursor)
|
||||
|
||||
|
@ -990,8 +990,8 @@ class WriteKodiDB():
|
|||
cursor.execute("delete FROM streamdetails WHERE idFile = ?", (fileid,))
|
||||
if streamdetails:
|
||||
#video details
|
||||
sql="insert into streamdetails(idFile, iStreamType, strVideoCodec, fVideoAspect, iVideoWidth, iVideoHeight) values(?, ?, ?, ?, ?, ?)"
|
||||
cursor.execute(sql, (fileid,0,streamdetails.get("videocodec"),streamdetails.get("aspectratio"),streamdetails.get("width"),streamdetails.get("height")))
|
||||
sql="insert into streamdetails(idFile, iStreamType, strVideoCodec, fVideoAspect, iVideoWidth, iVideoHeight, strStereoMode) values(?, ?, ?, ?, ?, ?, ?)"
|
||||
cursor.execute(sql, (fileid,0,streamdetails.get("videocodec"),streamdetails.get("aspectratio"),streamdetails.get("width"),streamdetails.get("height"),streamdetails.get("3dformat")))
|
||||
#audio details
|
||||
sql="insert into streamdetails(idFile, iStreamType, strAudioCodec, iAudioChannels) values(?, ?, ?, ?)"
|
||||
cursor.execute(sql, (fileid,1,streamdetails.get("audiocodec"),streamdetails.get("channels")))
|
||||
|
|
Loading…
Reference in a new issue