Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(10)  |  Derive(0)  |  Import(0)

src/s/y/SynoDLNAtrakt-HEAD/synodlnatrakt/web.py   SynoDLNAtrakt(Download)
def update():
    synoindex = request.forms.get('synoindex')
    imdb_id = request.forms.get('imdb_id')
    exec_date = datetime.now() + timedelta(seconds=2)
    sched.add_date_job(helper.updateMovie, exec_date, [synoindex, imdb_id])
 
    if search_term:
        sched.add_date_job(mediaimport.search, exec_date, [search_term, max_entrys])
        answer = {'status': 'success', 'message': 'force mediaserver import of {0} elements with {1} in name'.format(max_entrys, search_term)}
 
    # when none is selected query all...
    elif not mediatype and not folder and not search_term:
        # myresponse = main.import_mediaserver(force=True, max_entrys=int(max_entrys))
        sched.add_date_job(main.import_mediaserver, exec_date, [1, max_entrys])
    elif mediatype == "series"  and not search_term:
        # myresponse = mediaimport.series(max_entrys=int(max_entrys))
        sched.add_date_job(mediaimport.series, exec_date, [max_entrys])
        answer = {'status': 'success', 'message': 'force series import of {0} elements'.format(max_entrys)}
 
    elif mediatype == "movies" and not search_term:
        # myresponse = mediaimport.movies(max_entrys=int(max_entrys))
        sched.add_date_job(mediaimport.movies, exec_date, [max_entrys])