Esempio n. 1
0
        // Initializes the database connection to the Movies Plugin database
        private static void initDB()
        {
            if (_databaseManager != null)
            {
                return;
            }

            string fullDBBackupPath = Config.GetSubFolder(Config.Dir.Database, dbBackupPath);
            string fullDBFileName   = Config.GetFile(Config.Dir.Database, dbFileName);

            _databaseManager = new DatabaseManager(fullDBFileName, fullDBBackupPath);

            // check that we at least have a default user
            List <DBUser> users = DBUser.GetAll();

            if (users.Count == 0)
            {
                DBUser defaultUser = new DBUser();
                defaultUser.Name = "Default User";
                defaultUser.Commit();
            }

            // add all filter helpers
            _databaseManager.AddFilterHelper <DBMovieInfo>(new FilterHelperDBMovieInfo());
        }
        // Initializes the database connection to the Movies Plugin database
        private static void initDB()
        {
            if (_databaseManager != null)
                return;

            string fullDBBackupPath = Config.GetSubFolder(Config.Dir.Database, dbBackupPath);
            string fullDBFileName = Config.GetFile(Config.Dir.Database, dbFileName);
            _databaseManager = new DatabaseManager(fullDBFileName, fullDBBackupPath);

            // check that we at least have a default user
            List<DBUser> users = DBUser.GetAll();
            if (users.Count == 0) {
                DBUser defaultUser = new DBUser();
                defaultUser.Name = "Default User";
                defaultUser.Commit();
            }

            // add all filter helpers
            _databaseManager.AddFilterHelper<DBMovieInfo>(new FilterHelperDBMovieInfo());
        }