mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
Merge pull request #854 from oddstr13/fix-852-1
Add version gate to strHdrType field
This commit is contained in:
commit
64d8ebcbc8
2 changed files with 16 additions and 3 deletions
|
@ -3,7 +3,7 @@ from __future__ import division, absolute_import, print_function, unicode_litera
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
from ...helper import values, LazyLogger
|
from ...helper import values, LazyLogger, kodi_version
|
||||||
|
|
||||||
from . import artwork
|
from . import artwork
|
||||||
from . import queries as QU
|
from . import queries as QU
|
||||||
|
@ -241,7 +241,10 @@ class Kodi(object):
|
||||||
|
|
||||||
track['FileId'] = file_id
|
track['FileId'] = file_id
|
||||||
track['Runtime'] = runtime
|
track['Runtime'] = runtime
|
||||||
self.add_stream_video(*values(track, QU.add_stream_video_obj))
|
if kodi_version() < 20:
|
||||||
|
self.add_stream_video(*values(track, QU.add_stream_video_obj_19))
|
||||||
|
else:
|
||||||
|
self.add_stream_video(*values(track, QU.add_stream_video_obj))
|
||||||
|
|
||||||
for track in streams['audio']:
|
for track in streams['audio']:
|
||||||
|
|
||||||
|
@ -252,7 +255,10 @@ class Kodi(object):
|
||||||
self.add_stream_sub(*values({'language': track, 'FileId': file_id}, QU.add_stream_sub_obj))
|
self.add_stream_sub(*values({'language': track, 'FileId': file_id}, QU.add_stream_sub_obj))
|
||||||
|
|
||||||
def add_stream_video(self, *args):
|
def add_stream_video(self, *args):
|
||||||
self.cursor.execute(QU.add_stream_video, args)
|
if kodi_version() < 20:
|
||||||
|
self.cursor.execute(QU.add_stream_video_19, args)
|
||||||
|
else:
|
||||||
|
self.cursor.execute(QU.add_stream_video, args)
|
||||||
|
|
||||||
def add_stream_audio(self, *args):
|
def add_stream_audio(self, *args):
|
||||||
self.cursor.execute(QU.add_stream_audio, args)
|
self.cursor.execute(QU.add_stream_audio, args)
|
||||||
|
|
|
@ -262,6 +262,13 @@ INSERT INTO streamdetails(idFile, iStreamType, strVideoCodec, fVideoAspect,
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||||
"""
|
"""
|
||||||
add_stream_video_obj = ["{FileId}", 0, "{codec}", "{aspect}", "{width}", "{height}", "{Runtime}", "{3d}", "{hdrtype}"]
|
add_stream_video_obj = ["{FileId}", 0, "{codec}", "{aspect}", "{width}", "{height}", "{Runtime}", "{3d}", "{hdrtype}"]
|
||||||
|
# strHdrType is new to Kodi 20
|
||||||
|
add_stream_video_19 = """
|
||||||
|
INSERT INTO streamdetails(idFile, iStreamType, strVideoCodec, fVideoAspect, iVideoWidth,
|
||||||
|
iVideoHeight, iVideoDuration, strStereoMode)
|
||||||
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
||||||
|
"""
|
||||||
|
add_stream_video_obj_19 = ["{FileId}", 0, "{codec}", "{aspect}", "{width}", "{height}", "{Runtime}", "{3d}"]
|
||||||
add_stream_audio = """
|
add_stream_audio = """
|
||||||
INSERT INTO streamdetails(idFile, iStreamType, strAudioCodec, iAudioChannels, strAudioLanguage)
|
INSERT INTO streamdetails(idFile, iStreamType, strAudioCodec, iAudioChannels, strAudioLanguage)
|
||||||
VALUES (?, ?, ?, ?, ?)
|
VALUES (?, ?, ?, ?, ?)
|
||||||
|
|
Loading…
Reference in a new issue