Skip to content

Commit 08f5f5b

Browse files
author
amet
committed
[XBMC Subtitles] fixed: check for local subtitles
1 parent 6b305aa commit 08f5f5b

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

script.xbmc.subtitles/changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
1.6.5
2+
- fixed: check for existing subtitles
3+
14
1.6.4
25
- fixed: script would fail if 0 subtitles are found
36

script.xbmc.subtitles/default.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
__author__ = "Amet"
99
__url__ = "http://code.google.com/p/xbmc-subtitles/"
1010
__credits__ = ""
11-
__version__ = "1.6.4"
11+
__version__ = "1.6.5"
1212
__XBMC_Revision__ = "29565"
1313

1414
if not xbmc.getCondVisibility('Player.Paused') : xbmc.Player().pause() #Pause if not paused

script.xbmc.subtitles/description.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<id>script.xbmc.subtitles</id>
44
<type>script</type>
55
<title>XBMC Subtitles</title>
6-
<version>1.6.4</version>
6+
<version>1.6.5</version>
77
<library>default.py</library>
88
<platforms>
99
<platform>all</platform>

script.xbmc.subtitles/resources/lib/gui.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import unicodedata
99
from os.path import join
1010
import shutil
11-
import glob
11+
import fnmatch
1212

1313
_ = sys.modules[ "__main__" ].__language__
1414
__scriptname__ = sys.modules[ "__main__" ].__scriptname__
@@ -131,9 +131,13 @@ def set_allparam(self):
131131
os.mkdir(self.tmp_sub_dir)
132132
else:
133133
self.rem_files(self.tmp_sub_dir)
134-
135-
if not glob.glob ("%s.*.*" %(os.path.join(self.sub_folder,os.path.splitext(os.path.basename( movieFullPath ))[0],))):
136-
self.getControl( 111 ).setVisible( False )
134+
sub_ext = ["srt","sub","txt"]
135+
self.getControl( 111 ).setVisible( False )
136+
for file in os.listdir(self.sub_folder):
137+
for ext in sub_ext:
138+
if fnmatch.fnmatch(file, "*.??.%s" % (ext,)):
139+
self.getControl( 111 ).setVisible( True )
140+
break
137141

138142
#### ---------------------------- Set Service ----------------------------###
139143

0 commit comments

Comments
 (0)