예제 #1
0
파일: schedule.py 프로젝트: ARLahan/Flexget
def add_schedule(task):
    schedule = db_session.query(Schedule).filter(Schedule.task == task).first()
    if not schedule:
        schedule = Schedule(task, DEFAULT_INTERVAL)
        db_session.add(schedule)
        db_session.commit()
    start_timer(DEFAULT_INTERVAL)
    return redirect(url_for('.index'))
예제 #2
0
파일: schedule.py 프로젝트: gray/Flexget
def add_schedule(feed):
    schedule = db_session.query(Schedule).filter(Schedule.feed == feed).first()
    if not schedule:
        schedule = Schedule(feed, DEFAULT_INTERVAL)
        db_session.add(schedule)
        db_session.commit()
    start_timer(DEFAULT_INTERVAL)
    return redirect(url_for("index"))
예제 #3
0
def add_schedule(task):
    schedule = db_session.query(Schedule).filter(Schedule.task == task).first()
    if not schedule:
        schedule = Schedule(task, DEFAULT_INTERVAL)
        db_session.add(schedule)
        db_session.commit()
    start_timer(DEFAULT_INTERVAL)
    return redirect(url_for('index'))
예제 #4
0
파일: schedule.py 프로젝트: ARLahan/Flexget
def set_task_interval(task, interval):
    task_interval = db_session.query(Schedule).filter(Schedule.task == task).first()
    if task_interval:
        log.debug('Updating %s interval' % task)
        task_interval.interval = interval
    else:
        log.debug('Creating new %s interval' % task)
        db_session.add(Schedule(task, interval))
    db_session.commit()
    stop_empty_timers()
예제 #5
0
파일: schedule.py 프로젝트: gray/Flexget
def set_feed_interval(feed, interval):
    feed_interval = db_session.query(Schedule).filter(Schedule.feed == feed).first()
    if feed_interval:
        log.debug("Updating %s interval" % feed)
        feed_interval.interval = interval
    else:
        log.debug("Creating new %s interval" % feed)
        db_session.add(Schedule(feed, interval))
    db_session.commit()
    stop_empty_timers()
예제 #6
0
def set_task_interval(task, interval):
    task_interval = db_session.query(Schedule).filter(Schedule.task == task).first()
    if task_interval:
        log.debug('Updating %s interval' % task)
        task_interval.interval = interval
    else:
        log.debug('Creating new %s interval' % task)
        db_session.add(Schedule(task, interval))
    db_session.commit()
    stop_empty_timers()
예제 #7
0
def enable_authentication():
    if manager.options.no_auth:
        return
    global credentials
    credentials = db_session.query(AuthCredentials).first()
    if not credentials:
        credentials = AuthCredentials('flexget', 'flexget')
        db_session.add(credentials)

    if manager.options.username:
        credentials.username = manager.options.username
    if manager.options.password:
        credentials.password = manager.options.password
    db_session.commit()

    app.before_request(check_authenticated)
예제 #8
0
def enable_authentication():
    if manager.options.webui.no_auth:
        return
    global credentials
    credentials = db_session.query(AuthCredentials).first()
    if not credentials:
        credentials = AuthCredentials('flexget', 'flexget')
        db_session.add(credentials)

    if manager.options.webui.username:
        credentials.username = manager.options.username
    if manager.options.webui.password:
        credentials.password = manager.options.webui.password
    db_session.commit()

    app.before_request(check_authenticated)