Skip to content

Commit 86894ce

Browse files
Implement version_compare for VTT subs
1 parent 1ff6579 commit 86894ce

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

resources/lib/MSL.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def load_manifest(self, viewable_id, dolby, hevc, hdr, dolbyvision, vp9):
115115

116116
# subtitles
117117
addon = xbmcaddon.Addon('inputstream.adaptive')
118-
if addon and addon.getAddonInfo('version') >= '2.3.8':
118+
if addon and self.nx_common.compare_versions(map(int, addon.getAddonInfo('version').split('.')), [2, 3, 8]):
119119
manifest_request_data['profiles'].append('webvtt-lssdh-ios8')
120120
else:
121121
manifest_request_data['profiles'].append('simplesdh')

resources/lib/NetflixCommon.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,14 @@ def load_file(data_path, filename):
157157
@staticmethod
158158
def list_dir(data_path):
159159
return xbmcvfs.listdir(data_path)
160+
161+
@staticmethod
162+
def compare_versions(v1, v2):
163+
if len(v1) != len(v2):
164+
return len(v1) - len(v2)
165+
for i in range(0, len(v1)):
166+
if v1[i] > v2[1]:
167+
return 1
168+
elif v1[i] < v2[1]:
169+
return -1
170+
return 0

0 commit comments

Comments
 (0)