예제 #1
0
def createEDL():
    try:
        filterLoc = os.path.join( BASE_RESOURCE_PATH, "filter.txt" )
        safety = Addon.getSetting("safety")
        safety = float(safety) / 1000
        edl = EDLCreator(srtLoc, filterLoc, safety)
        if existsEDL(srtLoc):
            ret = dialog.yesno(details['label'], plugin.get_string(30301))
            if not ret:
                return False
        edl.createEDL()
        if Addon.getSetting("editsrt") == "true":
        	srt = NewSRTCreator(srtLoc, filterLoc)
        	if existsSRTbck(srtLoc):
        		os.rename(srtLoc + '.bck', srtLoc)
        	if srt.createNewSRT():
        		os.rename(srtLoc, srtLoc + '.bck')
        		os.rename(srtLoc[:-3] + "tmp", srtLoc)
        return True
    except:
        return False
예제 #2
0
    except:
        return False

try:
    mode=urllib.unquote_plus(params["mode"])
except:
    mode = None

if mode == 'movie-details':
    movieid=urllib.unquote_plus(params["id"])
    xbmc.log("movieid: %s" % str(movieid))
    details = data.getMovieDetails(movieid)
    xbmc.log('details: %s' % details)
    
    dialog = xbmcgui.Dialog()
    ret = dialog.yesno(details['label'], plugin.get_string(30302))
    if not ret:
        sys.exit()
    
    fileLoc = details['file']
    finder = subf.SubFinder(Addon, plugin)
    srtLoc = finder.getSRT(fileLoc)
    if srtLoc:
        xbmc.log("Using srt file: %s" % srtLoc)
        if createEDL():
            dialog.ok(details['label'], plugin.get_string(30303))
else:
    xbmc.log("Running %s v0.1. Using default listing." % ADDON_ID)
    movieDict = data.GetAllMovies()
    xbmc.log("movieDict: %s" % movieDict)
    win = xbmcgui.WindowDialog()