Esempio n. 1
0
    def create():
        interval = 60 * 60  # 1 hour

        now = datetime.datetime.today()

        hr = now.hour
        min = now.minute

        auto_start = False
        if core.CONFIG['Downloader']['Sources']['torrentenabled']:
            for name, config in core.CONFIG['Downloader']['Torrent'].items():
                ignore_remove_torrents = name == 'DelugeRPC' or name == 'DelugeWeb'
                if config['enabled'] and (not ignore_remove_torrents
                                          and config.get('removetorrents')
                                          or config.get('removestalledfor')):
                    auto_start = True
                    break

        SchedulerPlugin.ScheduledTask(hr,
                                      min,
                                      interval,
                                      FinishedTorrentsCheck.check_torrents,
                                      auto_start=auto_start,
                                      name='Torrents Status Check')
        return
Esempio n. 2
0
    def create():
        interval = core.CONFIG['Search']['rsssyncfrequency'] * 60

        now = datetime.datetime.today()
        hr = now.hour
        min = now.minute + core.CONFIG['Search']['rsssyncfrequency']

        SchedulerPlugin.ScheduledTask(hr, min, interval, search.search_all, auto_start=True, name='Movie Search')
Esempio n. 3
0
    def create():
        conf = core.CONFIG['Postprocessing']['Scanner']
        interval = conf['interval'] * 60

        now = datetime.datetime.today()
        hr = now.hour
        minute = now.minute + interval

        SchedulerPlugin.ScheduledTask(hr, minute, interval, PostProcessingScan.scan_directory, auto_start=conf['enabled'], name='PostProcessing Scan')
        return
Esempio n. 4
0
    def create():
        interval = 24 * 3600

        hr = core.CONFIG['System']['FileManagement']['scanmissinghour']
        min = core.CONFIG['System']['FileManagement']['scanmissingmin']

        auto_start = core.CONFIG['System']['FileManagement']['scanmissingfiles']

        SchedulerPlugin.ScheduledTask(hr, min, interval, Manage.scanmissingfiles, auto_start=auto_start, name='Missing Files Scan')
        return
Esempio n. 5
0
    def create():
        interval = 72 * 60 * 60  # 72 hours

        now = datetime.datetime.today()

        hr = now.hour
        min = now.minute

        SchedulerPlugin.ScheduledTask(hr, min, interval, MetadataUpdate.metadata_update, auto_start=True, name='Metadata Update')
        return
Esempio n. 6
0
    def create():
        interval = 60 * 60  # 1 hour

        now = datetime.datetime.today()

        hr = now.hour
        min = now.minute

        SchedulerPlugin.ScheduledTask(hr, min, interval, PostprocessedPathsScan.scan_paths, auto_start=True, name='Postprocessed Paths Scan')
        return
Esempio n. 7
0
    def create():
        interval = 24 * 3600

        hr = core.CONFIG['Search']['Watchlists']['popularmovieshour']
        min = core.CONFIG['Search']['Watchlists']['popularmoviesmin']

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

        SchedulerPlugin.ScheduledTask(hr, min, interval, popularmovies.sync_feed, auto_start=auto_start, name='PopularMovies Sync')
        return
Esempio n. 8
0
    def create():
        interval = core.CONFIG['Search']['Watchlists']['imdbfrequency'] * 60
        now = datetime.datetime.today()

        hr = now.hour
        min = now.minute + core.CONFIG['Search']['Watchlists']['imdbfrequency']

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

        SchedulerPlugin.ScheduledTask(hr, min, interval, imdb.sync, auto_start=auto_start, name='IMDB Sync')
        return
Esempio n. 9
0
    def create():

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

        now = datetime.datetime.today()
        hr = now.hour
        min = now.minute + (core.CONFIG['Server']['checkupdatefrequency'] * 60)
        if now.second > 30:
            min += 1

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

        SchedulerPlugin.ScheduledTask(hr, min, interval, AutoUpdateCheck.update_check, auto_start=auto_start, name='Update Checker')
        return
Esempio n. 10
0
    def create():
        interval = core.CONFIG['Search']['Watchlists']['traktfrequency'] * 60

        now = datetime.datetime.today()

        hr = now.hour
        min = now.minute + core.CONFIG['Search']['Watchlists']['traktfrequency']

        if core.CONFIG['Search']['Watchlists']['traktsync']:
            if any(core.CONFIG['Search']['Watchlists']['Traktlists'].keys()):
                auto_start = True
            else:
                logging.warning('Trakt sync enabled but no lists are enabled.')
                auto_start = False
        else:
            auto_start = False

        SchedulerPlugin.ScheduledTask(hr, min, interval, trakt.sync, auto_start=auto_start, name='Trakt Sync')
        return