Пример #1
0
        private void ParseSettings()
        {
            logger.IfInfo("Reading settings: " + SettingsPath());

            string configFile = "";
            try
            {
                StreamReader reader = new StreamReader(SettingsPath());
                configFile = RemoveJsonComments(reader);
                reader.Close();
            }
            catch (Exception e)
            {
                logger.Error("Could not open configuration file: " + SettingsPath());
                logger.Error(e);
            }

            // Grab all settings from the file
            settingsModel = JsonConvert.DeserializeObject<ServerSettingsData>(configFile);

            // Generate Folder objects from the media folders
            PrepareMediaFolders();

            dynamic json = JsonConvert.DeserializeObject(configFile);
            bool settingsChanged = false;

            try
            {
                string podcastFolderTemp = json.podcastFolderDoesntExist;
                settingsModel.PodcastFolder = podcastFolderTemp;
                settingsChanged = true;
            }
            catch { }

            logger.IfInfo("settings changed: " + settingsChanged);
        }
Пример #2
0
 public SettingsResponse(string error, ServerSettingsData settings)
 {
     Error = error;
     Settings = settings;
 }