Skip to content

Commit 12fc2f6

Browse files
committed
[fix] use xbmcvfs.translatePath when available, xbmc.translatePath deprecated(Matrix) and removed(Nexus)
1 parent 7afed3a commit 12fc2f6

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

addon.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
<extension point="xbmc.python.module" library="resources/lib/storage_server/"/>
88
<extension point="xbmc.addon.metadata">
99
<news>
10-
[fix] shutdown taking longer than 5 seconds
11-
[fix] ignore encoding issues for socket data
10+
[fix] use xbmcvfs.translatePath when available, xbmc.translatePath deprecated(Matrix) and removed(Nexus) |contrib: Gujal00|
1211
</news>
1312
<assets>
1413
<icon>icon.png</icon>

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Version 2.6.2
2+
[fix] use xbmcvfs.translatePath when available, xbmc.translatePath deprecated(Matrix) and removed(Nexus) |contrib: Gujal00|
3+
14
[B]Version 2.6.1[/B]
25
[fix] shutdown taking longer than 5 seconds
36
[fix] ignore encoding issues for socket data

resources/lib/storage_server/StorageServer.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ def __init__(self, table=None, timeout=24, instance=False):
6868
import xbmcgui
6969
self.xbmcgui = xbmcgui
7070

71+
if hasattr(self.xbmcvfs, "translatePath"):
72+
self.translate_path = self.xbmcvfs.translatePath
73+
else:
74+
self.translate_path = self.xbmc.translatePath
75+
7176
self.instance = instance
7277
self._sock = None
7378
self.die = False
@@ -81,7 +86,7 @@ def __init__(self, table=None, timeout=24, instance=False):
8186
self.version = to_unicode(self.settings.getAddonInfo('version'))
8287
self.plugin = u"StorageClient-" + self.version
8388

84-
self.path = to_unicode(self.xbmcvfs.translatePath('special://temp/'))
89+
self.path = to_unicode(self.translate_path('special://temp/'))
8590
if not self.xbmcvfs.exists(self.path):
8691
self._log(u"Making path structure: " + self.path)
8792
self.xbmcvfs.mkdir(self.path)
@@ -157,7 +162,7 @@ def _sock_init(self, check_stale=False):
157162

158163
if self._usePosixSockets():
159164
self._log("POSIX")
160-
self.socket = os.path.join(to_unicode(self.xbmcvfs.translatePath('special://temp/')),
165+
self.socket = os.path.join(to_unicode(self.translate_path('special://temp/')),
161166
'commoncache.socket')
162167
if self.xbmcvfs.exists(self.socket) and check_stale:
163168
self._log("Deleting stale socket file : " + self.socket)

0 commit comments

Comments
 (0)