xbmc.executebuiltin('PlayMedia("%s")' % title['file0'])

# Check installed
plugin.log('checking makemkvcon installed')
if not makemkvcon.installed():
  plugin.notify(plugin.lang(50001))
  sys.exit(1)

# Start
makemkvcon.start()
    
# Check that service is running
st = time.time()
ok = False
# TODO: dialog
while not ok and (time.time() - st) < plugin.get_int('disc_timeout'):
  plugin.log('waiting for makemkvcon')
  ok = makemkvcon.ready()
  time.sleep(0.5)
if not ok:
  plugin.notify(plugin.lang(50006))
  sys.exit(1)
plugin.log('makemkvcon ready')

# Process
params = parseQuery()

# Get titles
titles = makemkvcon.listTitles()
plugin.log('titles = %s' % str(titles))
if not titles:

# Check installed
plugin.log('checking makemkvcon installed')
if not makemkvcon.installed():
    plugin.notify(plugin.lang(50001))
    sys.exit(1)

# Start
makemkvcon.start()

# Check that service is running
st = time.time()
ok = False
# TODO: dialog
while not ok and (time.time() - st) < plugin.get_int('disc_timeout'):
    plugin.log('waiting for makemkvcon')
    ok = makemkvcon.ready()
    time.sleep(0.5)
if not ok:
    plugin.notify(plugin.lang(50006))
    sys.exit(1)
plugin.log('makemkvcon ready')

# Process
params = parseQuery()

# Get titles
titles = makemkvcon.listTitles()
plugin.log('titles = %s' % str(titles))
if not titles:
Example #3
0
# Service loop
key_checked  = 0
disc_current = None
disc_started = 0
disc_ready   = False
while not xbmc.abortRequested:

  # Update fixed key
  key = plugin.get('license_key')
  if key:
    makemkv.set(makemkv.APP_KEY, key)

  # Check for beta key
  elif plugin.get_bool('license_beta_auto'):
    period = plugin.get_int('license_beta_period') * 3600
    now    = time.time()
    if now - key_checked > period:
      if makemkv.updateLicense():
        plugin.notify(plugin.lang(50002))
      key_checked = now

  # Disc removed
  if disc_current:
    path = os.path.join('/media', disc_current, BDDIR)
    if not os.path.exists(path):
      plugin.notify(plugin.lang(50005) % disc_current)
      makemkvcon.kill()
      disc_current = None
      disc_ready   = False