Update service to show an alert if MakeMkvCon is not found

This commit is contained in:
Arne Bultman 2012-01-06 21:13:20 +01:00
parent 45cf03cb16
commit dab2624c88
3 changed files with 16 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -98,4 +98,16 @@ class MakeMkvInteraction:
self.log.info('Windows call successful')
except:
pass
def makeMkvExists(self):
(fin, fout) = os.popen4('%s -r' %(self.settings.mkvLocation))
result = fout.read()
self.log.info('Make mkv check returned %s' % (result.splitlines()[0]))
if result.splitlines()[0].startswith('Use: makemkvcon [switches] Command [Parameters]'):
self.log.info("MakeMkvCon found!")
return True
else:
self.log.info('MakeMkvcon seems not to be configured properly : %s' %(self.settings.mkvLocation))
return False

View File

@ -35,6 +35,10 @@ class MyPlayer(xbmc.Player):
myPlayer = MyPlayer()
xbmc.sleep(4)
if not makemkv.MakeMkvInteraction().makeMkvExists():
imagePath = os.path.join(__addon__.getAddonInfo('path'),'resources','images', 'alerticon.png')
xbmc.executebuiltin('Notification("MakeMkv", "The MakeMKV bluray plugin cannot find MakeMkv. Please configure the plugin to point to it", "15000", "%s")' % (imagePath))
while (not xbmc.abortRequested):
xbmc.sleep(4)