protected void LoadConfig()
        {
            var config = new Dictionary <string, string[]> ();

            if (File.Exists(IsAudioPlayerPath))
            {
                try {
                    using (var reader = new StreamReader(IsAudioPlayerPath)) {
                        config = new KeyValueParser(reader);
                        has_is_audio_player_file = true;
                    }
                } catch (Exception e) {
                    Log.Exception("Error parsing " + IsAudioPlayerPath, e);
                }
            }

            name = GetPreferredValue("name", config, DefaultName);
            cover_art_file_type = GetPreferredValue("cover_art_file_type", config, DefaultCoverArtFileType);
            cover_art_file_name = GetPreferredValue("cover_art_file_name", config, DefaultCoverArtFileName);
            cover_art_size      = GetPreferredValue("cover_art_size", config, DefaultCoverArtSize);
            audio_folders       = MergeValues("audio_folders", config, DefaultAudioFolders);
            video_folders       = MergeValues("video_folders", config, DefaultVideoFolders);
            playback_mime_types = MergeValues("output_formats", config, DefaultPlaybackMimeTypes);
            playlist_formats    = MergeValues("playlist_formats", config, DefaultPlaylistFormats);
            playlist_path       = GetPreferredValue("playlist_path", config, DefaultPlaylistPath);
            folder_depth        = GetPreferredValue("folder_depth", config, DefaultFolderDepth);
        }
Example #2
0
        protected void LoadConfig()
        {
            IDictionary <string, string[]> config = null;

            if (File.Exists(IsAudioPlayerPath))
            {
                try {
                    using (var reader = new StreamReader(IsAudioPlayerPath)) {
                        config = new KeyValueParser(reader);
                        has_is_audio_player_file = true;
                    }
                } catch (Exception e) {
                    Log.Exception("Error parsing " + IsAudioPlayerPath, e);
                }
            }

            LoadConfig(config);
        }