mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 10:46:11 +00:00
added stream language and subtitle language to streamdetails
This commit is contained in:
parent
c71634d18c
commit
d0325ba737
2 changed files with 34 additions and 11 deletions
|
@ -81,6 +81,8 @@ class API():
|
||||||
channels = ''
|
channels = ''
|
||||||
videocodec = ''
|
videocodec = ''
|
||||||
audiocodec = ''
|
audiocodec = ''
|
||||||
|
audiolanguage = ''
|
||||||
|
subtitlelanguage = ''
|
||||||
height = ''
|
height = ''
|
||||||
width = ''
|
width = ''
|
||||||
aspectratio = '1:1'
|
aspectratio = '1:1'
|
||||||
|
@ -114,15 +116,36 @@ class API():
|
||||||
except:
|
except:
|
||||||
aspectfloat = 1.85
|
aspectfloat = 1.85
|
||||||
if(mediaStream.get("Type") == "Audio"):
|
if(mediaStream.get("Type") == "Audio"):
|
||||||
audiocodec = mediaStream.get("Codec")
|
isdefault = mediaStream.get("IsDefault") == "true"
|
||||||
channels = mediaStream.get("Channels")
|
if audiocodec == '':
|
||||||
return {'channels' : str(channels),
|
audiocodec = mediaStream.get("Codec")
|
||||||
'videocodec' : videocodec,
|
if channels == '':
|
||||||
'audiocodec' : audiocodec,
|
channels = mediaStream.get("Channels")
|
||||||
'height' : height,
|
if audiolanguage == '':
|
||||||
'width' : width,
|
audiolanguage = mediaStream.get("Language")
|
||||||
'aspectratio' : aspectfloat,
|
# only overwrite if default
|
||||||
'3dformat' : Video3DFormat
|
if isdefault:
|
||||||
|
audiocodec = mediaStream.get("Codec")
|
||||||
|
channels = mediaStream.get("Channels")
|
||||||
|
audiolanguage = mediaStream.get("Language")
|
||||||
|
if(mediaStream.get("Type") == "Subtitle"):
|
||||||
|
isdefault = mediaStream.get("IsDefault") == "true"
|
||||||
|
if subtitlelanguage == '':
|
||||||
|
subtitlelanguage = mediaStream.get("Language")
|
||||||
|
# only overwrite if default
|
||||||
|
if isdefault:
|
||||||
|
subtitlelanguage = mediaStream.get("Language")
|
||||||
|
|
||||||
|
|
||||||
|
return {'channels' : str(channels),
|
||||||
|
'videocodec' : videocodec,
|
||||||
|
'audiocodec' : audiocodec,
|
||||||
|
'audiolanguage' : audiolanguage,
|
||||||
|
'subtitlelanguage' : subtitlelanguage,
|
||||||
|
'height' : height,
|
||||||
|
'width' : width,
|
||||||
|
'aspectratio' : aspectfloat,
|
||||||
|
'3dformat' : Video3DFormat
|
||||||
}
|
}
|
||||||
|
|
||||||
def getChecksum(self, item):
|
def getChecksum(self, item):
|
||||||
|
|
|
@ -1116,8 +1116,8 @@ class WriteKodiVideoDB():
|
||||||
sql="insert into streamdetails(idFile, iStreamType, strVideoCodec, fVideoAspect, iVideoWidth, iVideoHeight, strStereoMode) values(?, ?, ?, ?, ?, ?, ?)"
|
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")))
|
cursor.execute(sql, (fileid,0,streamdetails.get("videocodec"),streamdetails.get("aspectratio"),streamdetails.get("width"),streamdetails.get("height"),streamdetails.get("3dformat")))
|
||||||
#audio details
|
#audio details
|
||||||
sql="insert into streamdetails(idFile, iStreamType, strAudioCodec, iAudioChannels) values(?, ?, ?, ?)"
|
sql="insert into streamdetails(idFile, iStreamType, strAudioCodec, iAudioChannels, strAudioLanguage, strSubtitleLanguage) values(?, ?, ?, ?, ?, ?)"
|
||||||
cursor.execute(sql, (fileid,1,streamdetails.get("audiocodec"),streamdetails.get("channels")))
|
cursor.execute(sql, (fileid,1,streamdetails.get("audiocodec"),streamdetails.get("channels"),streamdetails.get("audiolanguage"),streamdetails.get("subtitlelanguage")))
|
||||||
|
|
||||||
def addBoxsetToKodiLibrary(self, boxset, connection, cursor):
|
def addBoxsetToKodiLibrary(self, boxset, connection, cursor):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue