示例#1
0
    def create():
        search = searcher.Searcher()
        interval = int(core.CONFIG['Search']['searchfrequency']) * 3600

        hr = int(core.CONFIG['Search']['searchtimehr'])
        min = int(core.CONFIG['Search']['searchtimemin'])

        task_search = taskscheduler.ScheduledTask(hr,
                                                  min,
                                                  interval,
                                                  search.auto_search_and_grab,
                                                  auto_start=True)

        # update core.NEXT_SEARCH
        delay = task_search.task.delay
        now = datetime.datetime.today().replace(second=0, microsecond=0)
        core.NEXT_SEARCH = now + datetime.timedelta(0, delay)
示例#2
0
    def create():
        interval = 24 * 3600

        hr = int(core.CONFIG['Server']['installupdatehr'])
        min = int(core.CONFIG['Server']['installupdatemin'])

        if core.CONFIG['Server']['installupdates'] == u'true':
            auto_start = True
        else:
            auto_start = False

        taskscheduler.ScheduledTask(hr,
                                    min,
                                    interval,
                                    AutoUpdateInstall.update_install,
                                    auto_start=auto_start)
        return
示例#3
0
    def create():
        interval = int(core.CONFIG['Search']['imdbfrequency']) * 60
        now = datetime.datetime.now()

        hr = now.hour
        min = now.minute + 5

        if core.CONFIG['Search']['imdbsync'] == u'true':
            auto_start = True
        else:
            auto_start = False

        taskscheduler.ScheduledTask(hr,
                                    min,
                                    interval,
                                    ImdbRssSync.sync_rss,
                                    auto_start=auto_start)
        return
示例#4
0
    def create():
        # Minimum of eight hours
        interval = max(int(core.CONFIG['Search']['popularmoviesfrequency']),
                       8) * 60 * 60
        now = datetime.datetime.now()

        hr = now.hour
        min = now.minute + 5

        if core.CONFIG['Search']['popularmoviessync'] == u'true':
            auto_start = True
        else:
            auto_start = False

        taskscheduler.ScheduledTask(hr,
                                    min,
                                    interval,
                                    PopularMoviesSync.sync_feed,
                                    auto_start=auto_start)
        return
示例#5
0
    def create():

        interval = int(core.CONFIG['Server']['checkupdatefrequency']) * 3600

        now = datetime.datetime.today()
        hr = now.hour
        min = now.minute
        if now.second > 30:
            min += 1

        if core.CONFIG['Server']['checkupdates'] == u'true':
            auto_start = True
        else:
            auto_start = False

        taskscheduler.ScheduledTask(hr,
                                    min,
                                    interval,
                                    AutoUpdateCheck.update_check,
                                    auto_start=auto_start)
        return