예제 #1
0
  # 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

  # Check for disc
  if plugin.get('disc_autoload') and not disc_ready:

    # Wait
    if disc_current:
      if makemkvcon.ready():
        disc_ready = True
        plugin.notify(plugin.lang(50004) % disc_current)
        if plugin.get('disc_autostart'):
          plugin.start()
      elif (time.time() - disc_started) > int(plugin.get('disc_timeout')):
        plugin.notify(plugin.lang(50006) % disc_current)
        disc_ready = True # stop watching

    # Check for new
    else:
      for d in os.listdir('/media'):
        p = os.path.join('/media', d, BDDIR)
        if os.path.exists(p):
          try:
            makemkvcon.start()
# 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:
  plugin.notify(plugin.lang(50007))
# 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:
    plugin.notify(plugin.lang(50007))
예제 #4
0
  # 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

  # Check for disc
  if plugin.get_bool('disc_autoload') and not disc_ready:

    # Wait
    if disc_current:
      if makemkvcon.ready():
        disc_ready = True
        plugin.notify(plugin.lang(50004) % disc_current)
        if plugin.get_bool('disc_autostart'):
          plugin.start()
      else:
        r = plugin.get_int('disc_timeout') - (time.time() - disc_started)
        if r <= 0:
          plugin.notify(plugin.lang(50006) % disc_current)
          disc_ready = True # stop watching
          # TODO: try and restart if first failure
        else:
          plugin.notify(plugin.lang(50008) % (disc_current, r))

    # Check for new
    else: