Пример #1
0
    def setup_state(self):
        self.url = u'http://pculture.org/feeds_test/unittest-feed-1.rss'
        self.feed = models.Feed(self.url)
        self.log_file = os.path.join(self.tempdir, 'miro-download-unit-tests')
        app.config.set(prefs.DOWNLOADER_LOG_PATHNAME, self.log_file)
        self.movies_dir = os.path.join(self.tempdir, 'movies-dir')
        if not os.path.exists(self.movies_dir):
            os.makedirs(self.movies_dir)
        app.config.set(prefs.MOVIES_DIRECTORY, self.movies_dir)

        # initialize and start the downloader after fixing the MOVIES_DIRECTORY
        downloader.init_controller()
        downloader.startup_downloader()
Пример #2
0
    def setup_state(self):
        self.url = u'http://pculture.org/feeds_test/unittest-feed-1.rss'
        self.feed = models.Feed(self.url)
        self.log_file = os.path.join(self.tempdir, 'miro-download-unit-tests')
        app.config.set(prefs.DOWNLOADER_LOG_PATHNAME, self.log_file)
        self.movies_dir = os.path.join(self.tempdir, 'movies-dir')
        if not os.path.exists(self.movies_dir):
            os.makedirs(self.movies_dir)
        app.config.set(prefs.MOVIES_DIRECTORY, self.movies_dir)

        # initialize and start the downloader after fixing the MOVIES_DIRECTORY
        downloader.init_controller()
        downloader.startup_downloader()
Пример #3
0
    logging.info("Loading video converters...")
    conversions.conversion_manager.startup()
    app.device_manager = devices.DeviceManager()
    app.device_tracker = devicetracker.DeviceTracker()

    searchengines.create_engines()
    setup_global_feeds()
    # call fix_database_inconsistencies() ASAP after the manual feed is set up
    fix_database_inconsistencies()
    logging.info("setup tabs...")
    setup_tabs()
    logging.info("setup theme...")
    setup_theme()
    install_message_handler()
    downloader.init_controller()

    eventloop.add_urgent_call(check_firsttime, "check first time")

def fix_database_inconsistencies():
    item.fix_non_container_parents()
    item.move_orphaned_items()
    playlist.fix_missing_item_ids()
    folder.fix_playlist_missing_item_ids()

@startup_function
def check_firsttime():
    """Run the first time wizard if need be.
    """
    callback = lambda: eventloop.add_urgent_call(check_movies_gone, "check movies gone")
    if is_first_time():
Пример #4
0
    logging.info("Loading video converters...")
    conversions.conversion_manager.startup()
    app.device_manager = devices.DeviceManager()
    app.device_tracker = devicetracker.DeviceTracker()

    searchengines.create_engines()
    setup_global_feeds()
    # call fix_database_inconsistencies() ASAP after the manual feed is set up
    fix_database_inconsistencies()
    logging.info("setup tabs...")
    setup_tabs()
    logging.info("setup theme...")
    setup_theme()
    install_message_handler()
    itemsource.setup_handlers()
    downloader.init_controller()

    # Call this late, after the message handlers have been installed.
    app.sharing_tracker = sharing.SharingTracker()
    app.sharing_manager = sharing.SharingManager()
    app.transcode_manager = transcode.TranscodeManager()

    eventloop.add_urgent_call(check_firsttime, "check first time")


def fix_database_inconsistencies():
    item.fix_non_container_parents()
    item.move_orphaned_items()
    playlist.fix_missing_item_ids()
    folder.fix_playlist_missing_item_ids()