mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16: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 = ''
|
||||
videocodec = ''
|
||||
audiocodec = ''
|
||||
audiolanguage = ''
|
||||
subtitlelanguage = ''
|
||||
height = ''
|
||||
width = ''
|
||||
aspectratio = '1:1'
|
||||
|
@ -114,15 +116,36 @@ class API():
|
|||
except:
|
||||
aspectfloat = 1.85
|
||||
if(mediaStream.get("Type") == "Audio"):
|
||||
audiocodec = mediaStream.get("Codec")
|
||||
channels = mediaStream.get("Channels")
|
||||
return {'channels' : str(channels),
|
||||
'videocodec' : videocodec,
|
||||
'audiocodec' : audiocodec,
|
||||
'height' : height,
|
||||
'width' : width,
|
||||
'aspectratio' : aspectfloat,
|
||||
'3dformat' : Video3DFormat
|
||||
isdefault = mediaStream.get("IsDefault") == "true"
|
||||
if audiocodec == '':
|
||||
audiocodec = mediaStream.get("Codec")
|
||||
if channels == '':
|
||||
channels = mediaStream.get("Channels")
|
||||
if audiolanguage == '':
|
||||
audiolanguage = mediaStream.get("Language")
|
||||
# only overwrite if default
|
||||
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):
|
||||
|
|
|
@ -1116,8 +1116,8 @@ class WriteKodiVideoDB():
|
|||
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")))
|
||||
sql="insert into streamdetails(idFile, iStreamType, strAudioCodec, iAudioChannels, strAudioLanguage, strSubtitleLanguage) values(?, ?, ?, ?, ?, ?)"
|
||||
cursor.execute(sql, (fileid,1,streamdetails.get("audiocodec"),streamdetails.get("channels"),streamdetails.get("audiolanguage"),streamdetails.get("subtitlelanguage")))
|
||||
|
||||
def addBoxsetToKodiLibrary(self, boxset, connection, cursor):
|
||||
|
||||
|
|
Loading…
Reference in a new issue