Skip to content

Commit 8a06b16

Browse files
authored
Merge pull request #2443 from sanpoChew/matrix-script.module.t1mlib-4.0.8
[script.module.t1mlib] 4.0.8
2 parents 49d4214 + e6a5cea commit 8a06b16

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

script.module.t1mlib/addon.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
2-
<addon id="script.module.t1mlib" name="t1m Library Routines" provider-name="t1m" version="4.0.7">
2+
<addon id="script.module.t1mlib" name="t1m Library Routines" provider-name="t1m" version="4.0.8">
33
<requires>
44
<import addon="xbmc.python" version="3.0.0" />
55
<import addon="script.module.requests" version="2.22.0"/>
@@ -15,7 +15,7 @@
1515
<forum>https://forum.kodi.tv/showthread.php?tid=247163</forum>
1616
<source>https://github.com/learningit/repo-scripts></source>
1717
<language>en</language>
18-
<news>v4.0.7 - fix tv listings for live stream addons</news>
18+
<news>v4.0.8 - nexus support</news>
1919
<assets>
2020
<icon>resources/icon.png</icon>
2121
</assets>

script.module.t1mlib/lib/t1mlib.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def __init__(self, aname):
3636
self.addonName = self.addon.getAddonInfo('name')
3737
self.localLang = self.addon.getLocalizedString
3838
self.homeDir = self.addon.getAddonInfo('path')
39-
self.addonIcon = xbmc.translatePath(os.path.join(self.homeDir, 'resources', 'icon.png'))
40-
self.addonFanart = xbmc.translatePath(os.path.join(self.homeDir,'resources' 'fanart.jpg'))
39+
self.addonIcon = xbmcvfs.translatePath(os.path.join(self.homeDir, 'resources', 'icon.png'))
40+
self.addonFanart = xbmcvfs.translatePath(os.path.join(self.homeDir,'resources' 'fanart.jpg'))
4141
self.defaultHeaders = httpHeaders
4242
self.defaultVidStream = {'codec': 'h264', 'width': 1280, 'height': 720, 'aspect': 1.78}
4343
self.defaultAudStream = {'codec': 'aac', 'language': 'en'}
@@ -175,8 +175,8 @@ def makeLibraryPath(self, ftype, name=None):
175175
if name is None:
176176
name = self.cleanFilename(xbmc.getInfoLabel('ListItem.Title').replace('(Series)','',1).strip())
177177
profile = self.script.getAddonInfo('profile')
178-
moviesDir = xbmc.translatePath(os.path.join(profile,str(ftype)))
179-
movieDir = xbmc.translatePath(os.path.join(moviesDir, name))
178+
moviesDir = xbmcvfs.translatePath(os.path.join(profile,str(ftype)))
179+
movieDir = xbmcvfs.translatePath(os.path.join(moviesDir, name))
180180
if not os.path.isdir(movieDir):
181181
os.makedirs(movieDir)
182182
return movieDir
@@ -189,20 +189,20 @@ def doScan(self,movieDir):
189189
def addMusicVideoToLibrary(self, url):
190190
from xml.etree.ElementTree import Element
191191
from xml.etree.ElementTree import tostring
192-
import html.parser
192+
import html
193193
from xml.dom import minidom
194-
UNESCAPE = html.parser.HTMLParser().unescape
194+
UNESCAPE = html.unescape
195195

196196
url, infoList = urllib.parse.unquote_plus(url).split('||',1)
197197
infoList = eval(infoList)
198198
artist = infoList.get('artist')
199199
title = infoList.get('title')
200200
movieDir = self.makeLibraryPath('music_videos', name=self.cleanFilename(artist))
201-
strmFile = xbmc.translatePath(os.path.join(movieDir, ''.join([self.cleanFilename(title),'.strm'])))
201+
strmFile = xbmcvfs.translatePath(os.path.join(movieDir, ''.join([self.cleanFilename(title),'.strm'])))
202202
url = ''.join([sys.argv[0],'?mode=GV&url=',url])
203203
with open(strmFile, 'w') as outfile:
204204
outfile.write(url)
205-
nfoFile = xbmc.translatePath(os.path.join(movieDir, ''.join([self.cleanFilename(title),'.nfo'])))
205+
nfoFile = xbmcvfs.translatePath(os.path.join(movieDir, ''.join([self.cleanFilename(title),'.nfo'])))
206206
nfoData = Element('musicvideo')
207207
for key, val in infoList.items():
208208
child = Element(key)
@@ -219,7 +219,7 @@ def addMusicVideoToLibrary(self, url):
219219
def addMovieToLibrary(self, url):
220220
name = self.cleanFilename(''.join([xbmc.getInfoLabel('ListItem.Title'),'.strm']))
221221
movieDir = self.makeLibraryPath('movies')
222-
strmFile = xbmc.translatePath(os.path.join(movieDir, name))
222+
strmFile = xbmcvfs.translatePath(os.path.join(movieDir, name))
223223
url = ''.join([sys.argv[0],'?mode=GV&url=',url])
224224
with open(strmFile, 'w') as outfile:
225225
outfile.write(url)
@@ -238,7 +238,7 @@ def addShowByDate(self,url):
238238
title = self.cleanFilename(str(liz.getVideoInfoTag().getTitle()))
239239
TVShowTitle = self.cleanFilename(str(liz.getVideoInfoTag().getTVShowTitle()))
240240
se = ''.join([TVShowTitle,' ',pdate,' [',title,'].strm'])
241-
strmFile = xbmc.translatePath(os.path.join(movieDir, se))
241+
strmFile = xbmcvfs.translatePath(os.path.join(movieDir, se))
242242
with open(strmFile, 'w') as outfile:
243243
outfile.write(url)
244244
self.doScan(movieDir)
@@ -253,7 +253,7 @@ def addShowToLibrary(self,url):
253253
episode = str(liz.getVideoInfoTag().getEpisode())
254254
title = self.cleanFilename(str(liz.getVideoInfoTag().getTitle()))
255255
se = ''.join(['S',season,'E',episode,' ',title,'.strm'])
256-
strmFile = xbmc.translatePath(os.path.join(movieDir, se))
256+
strmFile = xbmcvfs.translatePath(os.path.join(movieDir, se))
257257
with open(strmFile, 'w') as outfile:
258258
outfile.write(url)
259259
self.doScan(movieDir)

script.module.t1mlib/readme.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ Library of support routines for t1m addons
55

66
V4.0.4 Matrix version - added music video support
77
V4.0.6 - fix for Android file write having a Type Error
8-
v4.0.7 - fix tv listings for live stream addons
8+
v4.0.7 - fix tv listings for live stream addons
9+
v4.0.8 - nexus support

0 commit comments

Comments
 (0)