Esempio n. 1
0
        /// <summary>
        /// Loads the Settings
        /// </summary>
        public static void Load()
        {
            try
            {
                XmlReader xmlReader = new XmlReader();
                xmlReader.Load(SettingsFile);

                TraktUsername = xmlReader.GetSettingValueAsString(cTraktUsername, string.Empty);
                TraktPassword = xmlReader.GetSettingValueAsString(cTraktPassword, string.Empty);
                TraktOAuthToken = xmlReader.GetSettingValueAsString(cTraktOAuthToken, string.Empty);
                TraktOAuth = xmlReader.GetSettingValueAsBool(cTraktOAuth, TraktPassword == string.Empty ? true : false);
                TVDbAccountIdentifier = xmlReader.GetSettingValueAsString(cTVDbAccountId, string.Empty);
                TMDbSessionId = xmlReader.GetSettingValueAsString(cTMDbSessionId, string.Empty);
                TMDbSyncWatchlist = xmlReader.GetSettingValueAsBool(cTMDBSyncWatchlist, true);
                IMDbRatingsFilename = xmlReader.GetSettingValueAsString(cIMDbRatingsFilename, string.Empty);
                IMDbWatchlistFilename = xmlReader.GetSettingValueAsString(cIMDbWatchlistFilename, string.Empty);
                IMDbUsername = xmlReader.GetSettingValueAsString(cIMDbUsername, string.Empty);
                IMDbCustomLists = xmlReader.GetSettingValueAsString(cIMDbCustomLists, string.Empty).FromJSONArray<string>().ToList();
                IMDbSyncWatchlist = xmlReader.GetSettingValueAsBool(cIMDBSyncWatchlist, false);
                ListalSyncWatchlist = xmlReader.GetSettingValueAsBool(cListalSyncWatchlist, false);
                ListalMovieFilename = xmlReader.GetSettingValueAsString(cListalMovieFilename, string.Empty);
                ListalShowFilename = xmlReader.GetSettingValueAsString(cListalShowFilename, string.Empty);
                CritickerMovieFilename = xmlReader.GetSettingValueAsString(cCritickerMovieFilename, string.Empty);
                LetterboxdRatingsFilename = xmlReader.GetSettingValueAsString(cLetterboxdRatingsFilename, string.Empty);
                LetterboxdWatchedFilename = xmlReader.GetSettingValueAsString(cLetterboxdWatchedFilename, string.Empty);
                LetterboxdDiaryFilename = xmlReader.GetSettingValueAsString(cLetterboxdDiaryFilename, string.Empty);
                FlixsterUserId = xmlReader.GetSettingValueAsString(cFlixsterUserId, string.Empty);
                FlixsterSyncWantToSee = xmlReader.GetSettingValueAsBool(cFlixsterSyncWantToSee, true);
                MarkAsWatched = xmlReader.GetSettingValueAsBool(cMarkAsWatched, true);
                IgnoreWatchedForWatchlist = xmlReader.GetSettingValueAsBool(cIgnoreWatchedForWatchlist, true);
                EnableIMDb = xmlReader.GetSettingValueAsBool(cEnableIMDb, false);
                EnableTMDb = xmlReader.GetSettingValueAsBool(cEnableTMDb, false);
                EnableTVDb = xmlReader.GetSettingValueAsBool(cEnableTVDb, false);
                EnableListal = xmlReader.GetSettingValueAsBool(cEnableListal, false);
                EnableCriticker = xmlReader.GetSettingValueAsBool(cEnableCriticker, false);
                EnableLetterboxd = xmlReader.GetSettingValueAsBool(cEnableLetterboxd, false);
                EnableFlixster = xmlReader.GetSettingValueAsBool(cEnableFlixster, false);
                LogSeverityLevel = (LoggingSeverity)(xmlReader.GetSettingValueAsInt(cLogLevel, 3));
                BatchSize = xmlReader.GetSettingValueAsInt(cBatchSize, 50);
                WatchedOnReleaseDay = xmlReader.GetSettingValueAsBool(cWatchedOnReleaseDay, false);

                // save settings, might be some new settings added
                Save();
            }
            catch (Exception)
            {
                return;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Loads the Settings
        /// </summary>
        public static void Load()
        {
            try {
                XmlReader xmlReader = new XmlReader();
                xmlReader.Load(SettingsFile);

                TraktUsername = xmlReader.GetSettingValueAsString(cTraktUsername, string.Empty);
                TraktPassword = xmlReader.GetSettingValueAsString(cTraktPassword, string.Empty);
                TVDbAccountIdentifier = xmlReader.GetSettingValueAsString(cTVDbAccountId, string.Empty);
                TMDbSessionId = xmlReader.GetSettingValueAsString(cTMDbSessionId, string.Empty);
                TMDbSyncWatchlist = xmlReader.GetSettingValueAsBool(cTMDBSyncWatchlist, true);
                IMDbRatingsFilename = xmlReader.GetSettingValueAsString(cIMDbRatingsFilename, string.Empty);
                IMDbWatchlistFilename = xmlReader.GetSettingValueAsString(cIMDbWatchlistFilename, string.Empty);
                IMDbUsername = xmlReader.GetSettingValueAsString(cIMDbUsername, string.Empty);
                IMDbSyncWatchlist = xmlReader.GetSettingValueAsBool(cIMDBSyncWatchlist, false);
                ListalSyncWatchlist = xmlReader.GetSettingValueAsBool(cListalSyncWatchlist, false);
                ListalMovieFilename = xmlReader.GetSettingValueAsString(cListalMovieFilename, string.Empty);
                ListalShowFilename = xmlReader.GetSettingValueAsString(cListalShowFilename, string.Empty);
                CritickerMovieFilename = xmlReader.GetSettingValueAsString(cCritickerMovieFilename, string.Empty);
                MarkAsWatched = xmlReader.GetSettingValueAsBool(cMarkAsWatched, true);
                IgnoreWatchedForWatchlist = xmlReader.GetSettingValueAsBool(cIgnoreWatchedForWatchlist, true);
                EnableIMDb = xmlReader.GetSettingValueAsBool(cEnableIMDb, false);
                EnableTMDb = xmlReader.GetSettingValueAsBool(cEnableTMDb, false);
                EnableTVDb = xmlReader.GetSettingValueAsBool(cEnableTVDb, false);
                EnableListal = xmlReader.GetSettingValueAsBool(cEnableListal, false);
                EnableCriticker = xmlReader.GetSettingValueAsBool(cEnableCriticker, false);
                LogSeverityLevel = (LoggingSeverity)(xmlReader.GetSettingValueAsInt(cLogLevel, 3));
                BatchSize = xmlReader.GetSettingValueAsInt(cBatchSize, 50);

                // save settings, might be some new settings added
                Save();
            }
            catch (Exception) {
                return;
            }
        }