public void Load() { StringDictionary settings = new StringDictionary(); MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")); //MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml"); JMMServer_Address = xmlreader.GetValueAsString("Anime3", "JMMServer_Address", "127.0.0.1"); JMMServer_Port = xmlreader.GetValueAsString("Anime3", "JMMServer_Port", "8111"); ImportFolderMappingsList = xmlreader.GetValueAsString("Anime3", "ImportFolderMappingsList", ""); CurrentJMMUserID = xmlreader.GetValueAsString("Anime3", "CurrentJMMUserID", ""); thumbsFolder = xmlreader.GetValueAsString("Anime3", "ThumbsFolder", ""); PluginName = xmlreader.GetValueAsString("Anime3", "PluginName", "My Anime 3"); //XMLWebServiceIP = xmlreader.GetValueAsString("Anime2", "XMLWebServiceIP", "anime.hobbydb.net"); LastGroupList = xmlreader.GetValueAsString("Anime2", "LastGroupList", ""); BakaBTUsername = xmlreader.GetValueAsString("Anime3", "BakaBTUsername", ""); BakaBTPassword = xmlreader.GetValueAsString("Anime3", "BakaBTPassword", ""); AnimeBytesUsername = xmlreader.GetValueAsString("Anime3", "AnimeBytesUsername", ""); AnimeBytesPassword = xmlreader.GetValueAsString("Anime3", "AnimeBytesPassword", ""); UTorrentAddress = xmlreader.GetValueAsString("Anime3", "UTorrentAddress", ""); UTorrentPassword = xmlreader.GetValueAsString("Anime3", "UTorrentPassword", ""); UTorrentPort = xmlreader.GetValueAsString("Anime3", "UTorrentPort", ""); UTorrentUsername = xmlreader.GetValueAsString("Anime3", "UTorrentUsername", ""); TorrentSourcesRaw = xmlreader.GetValueAsString("Anime3", "TorrentSources", AnimePluginSettings.TorrentSourcesAll); TorrentPreferOwnGroups = GetBooleanSetting(ref xmlreader, "TorrentPreferOwnGroups", true); WatchedPercentage = int.Parse(xmlreader.GetValueAsString("Anime3", "WatchedPercentage", "90")); EpisodeDisplayFormat = xmlreader.GetValueAsString("Anime3", "EpisodeDisplayFormat", @"<EpNo>: <EpName>"); fileSelectionDisplayFormat = xmlreader.GetValueAsString("Anime3", "FileSelectionDisplayFormat", @"<AnGroupShort> - <FileRes> / <FileSource> / <VideoBitDepth>bit"); ShowMissing = GetBooleanSetting(ref xmlreader, "ShowMissing", true); ShowMissingMyGroupsOnly = GetBooleanSetting(ref xmlreader, "ShowMissingMyGroupsOnly", false); DisplayRatingDialogOnCompletion = GetBooleanSetting(ref xmlreader, "DisplayRatingDialogOnCompletion", true); SingleSeriesGroups = GetBooleanSetting(ref xmlreader, "SingleSeriesGroups", false); string viewMode = ""; viewMode = xmlreader.GetValueAsString("Anime3", "LastGroupViewMode", "0"); LastGroupViewMode = (GUIFacadeControl.Layout)int.Parse(viewMode); string viewModeFan = ""; viewModeFan = xmlreader.GetValueAsString("Anime3", "LastFanartViewMode", "1"); LastFanartViewMode = (GUIFacadeControl.Layout)int.Parse(viewModeFan); string viewModePoster = ""; viewModePoster = xmlreader.GetValueAsString("Anime3", "LastPosterViewMode", "2"); LastPosterViewMode = (GUIFacadeControl.Layout)int.Parse(viewModePoster); HideWatchedFiles = GetBooleanSetting(ref xmlreader, "HideWatchedFiles", false); DefaultAudioLanguage = xmlreader.GetValueAsString("Anime3", "DefaultAudioLanguage", @"<file>"); DefaultSubtitleLanguage = xmlreader.GetValueAsString("Anime3", "DefaultSubtitleLanguage", @"<file>"); string findtimeout = ""; findtimeout = xmlreader.GetValueAsString("Anime3", "FindTimeout", "3"); FindTimeout_s = int.Parse(findtimeout); string findmode = ""; findmode = xmlreader.GetValueAsString("Anime3", "FindMode", "0"); FindMode = (SearchMode)int.Parse(findmode); FindStartWord = GetBooleanSetting(ref xmlreader, "FindStartWord", true); FindFilter = GetBooleanSetting(ref xmlreader, "FindFilter", true); AniDBAutoEpisodesSubbed = GetBooleanSetting(ref xmlreader, "AniDBAutoEpisodesSubbed", true); ShowOnlyAvailableEpisodes = GetBooleanSetting(ref xmlreader, "ShowOnlyAvailableEpisodes", true); HidePlot = GetBooleanSetting(ref xmlreader, "HidePlot", true); MenuDeleteFiles = GetBooleanSetting(ref xmlreader, "MenuDeleteFiles", false); string infodel = ""; infodel = xmlreader.GetValueAsString("Anime3", "InfoDelay", "150"); InfoDelay = int.Parse(infodel); string postpct = ""; postpct = xmlreader.GetValueAsString("Anime3", "PosterSizePct", "50"); int tmpPost = 0; int.TryParse(postpct, out tmpPost); if (tmpPost > 0 && tmpPost <= 100) PosterSizePct = tmpPost; else PosterSizePct = 50; string banpct = ""; banpct = xmlreader.GetValueAsString("Anime3", "BannerSizePct", "50"); int tmpBanner = 0; int.TryParse(banpct, out tmpBanner); if (tmpBanner > 0 && tmpBanner <= 100) BannerSizePct = tmpBanner; else BannerSizePct = 50; string ffdshowNotificationsShow = ""; ffdshowNotificationsShow = xmlreader.GetValueAsString("Anime3", "FfdshowNotificationsShow", "1"); FfdshowNotificationsShow = ffdshowNotificationsShow == "0" ? false : true; string ffdshowNotificationsAutoClose = ""; ffdshowNotificationsAutoClose = xmlreader.GetValueAsString("Anime3", "FfdshowNotificationsAutoClose", "1"); FfdshowNotificationsAutoClose = ffdshowNotificationsAutoClose == "0" ? false : true; string ffdshowNotificationsLock = ""; ffdshowNotificationsLock = xmlreader.GetValueAsString("Anime3", "FfdshowNotificationsLock", "1"); FfdshowNotificationsLock = ffdshowNotificationsLock == "0" ? false : true; FfdshowNotificationsAutoCloseTime = int.Parse(xmlreader.GetValueAsString("Anime3", "FfdshowNotificationsAutoCloseTime", "3000")); FfdshowNotificationsLockTime = int.Parse(xmlreader.GetValueAsString("Anime3", "FfdshowNotificationsLockTime", "5000")); xmlreader.Dispose(); // parse the list of torrent sources if (TorrentSourcesRaw.Length > 0) { string[] fitems = TorrentSourcesRaw.Split(';'); foreach (string s in fitems) { TorrentSources.Add(s); } } }
public void Load() { StringDictionary settings = new StringDictionary(); MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")); //MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml"); JMMServer_Address = xmlreader.GetValueAsString("Anime3", "JMMServer_Address", "127.0.0.1"); JMMServer_Port = xmlreader.GetValueAsString("Anime3", "JMMServer_Port", "8111"); ImportFolderMappingsList = xmlreader.GetValueAsString("Anime3", "ImportFolderMappingsList", ""); CurrentJMMUserID = xmlreader.GetValueAsString("Anime3", "CurrentJMMUserID", ""); thumbsFolder = xmlreader.GetValueAsString("Anime3", "ThumbsFolder", ""); PluginName = xmlreader.GetValueAsString("Anime3", "PluginName", "My Anime 3"); //XMLWebServiceIP = xmlreader.GetValueAsString("Anime2", "XMLWebServiceIP", "anime.hobbydb.net"); LastGroupList = xmlreader.GetValueAsString("Anime2", "LastGroupList", ""); BakaBTUsername = xmlreader.GetValueAsString("Anime3", "BakaBTUsername", ""); BakaBTPassword = xmlreader.GetValueAsString("Anime3", "BakaBTPassword", ""); AnimeBytesUsername = xmlreader.GetValueAsString("Anime3", "AnimeBytesUsername", ""); AnimeBytesPassword = xmlreader.GetValueAsString("Anime3", "AnimeBytesPassword", ""); UTorrentAddress = xmlreader.GetValueAsString("Anime3", "UTorrentAddress", ""); UTorrentPassword = xmlreader.GetValueAsString("Anime3", "UTorrentPassword", ""); UTorrentPort = xmlreader.GetValueAsString("Anime3", "UTorrentPort", ""); UTorrentUsername = xmlreader.GetValueAsString("Anime3", "UTorrentUsername", ""); TorrentSourcesRaw = xmlreader.GetValueAsString("Anime3", "TorrentSources", AnimePluginSettings.TorrentSourcesAll); TorrentPreferOwnGroups = GetBooleanSetting(ref xmlreader, "TorrentPreferOwnGroups", true); WatchedPercentage = int.Parse(xmlreader.GetValueAsString("Anime3", "WatchedPercentage", "90")); EpisodeDisplayFormat = xmlreader.GetValueAsString("Anime3", "EpisodeDisplayFormat", @"<EpNo>: <EpName>"); fileSelectionDisplayFormat = xmlreader.GetValueAsString("Anime3", "FileSelectionDisplayFormat", @"<AnGroupShort> - <FileRes> / <FileSource> / <VideoBitDepth>bit"); ShowMissing = GetBooleanSetting(ref xmlreader, "ShowMissing", true); ShowMissingMyGroupsOnly = GetBooleanSetting(ref xmlreader, "ShowMissingMyGroupsOnly", false); DisplayRatingDialogOnCompletion = GetBooleanSetting(ref xmlreader, "DisplayRatingDialogOnCompletion", true); SingleSeriesGroups = GetBooleanSetting(ref xmlreader, "SingleSeriesGroups", false); string viewMode = ""; viewMode = xmlreader.GetValueAsString("Anime3", "LastGroupViewMode", "0"); LastGroupViewMode = (GUIFacadeControl.Layout) int.Parse(viewMode); string viewModeFan = ""; viewModeFan = xmlreader.GetValueAsString("Anime3", "LastFanartViewMode", "1"); LastFanartViewMode = (GUIFacadeControl.Layout) int.Parse(viewModeFan); string viewModePoster = ""; viewModePoster = xmlreader.GetValueAsString("Anime3", "LastPosterViewMode", "2"); LastPosterViewMode = (GUIFacadeControl.Layout) int.Parse(viewModePoster); HideWatchedFiles = GetBooleanSetting(ref xmlreader, "HideWatchedFiles", false); DefaultAudioLanguage = xmlreader.GetValueAsString("Anime3", "DefaultAudioLanguage", @"<file>"); DefaultSubtitleLanguage = xmlreader.GetValueAsString("Anime3", "DefaultSubtitleLanguage", @"<file>"); string findtimeout = ""; findtimeout = xmlreader.GetValueAsString("Anime3", "FindTimeout", "3"); FindTimeout_s = int.Parse(findtimeout); string findmode = ""; findmode = xmlreader.GetValueAsString("Anime3", "FindMode", "0"); FindMode = (SearchMode)int.Parse(findmode); FindStartWord = GetBooleanSetting(ref xmlreader, "FindStartWord", true); FindFilter = GetBooleanSetting(ref xmlreader, "FindFilter", true); AniDBAutoEpisodesSubbed = GetBooleanSetting(ref xmlreader, "AniDBAutoEpisodesSubbed", true); ShowOnlyAvailableEpisodes = GetBooleanSetting(ref xmlreader, "ShowOnlyAvailableEpisodes", true); HidePlot = GetBooleanSetting(ref xmlreader, "HidePlot", true); MenuDeleteFiles = GetBooleanSetting(ref xmlreader, "MenuDeleteFiles", false); string infodel = ""; infodel = xmlreader.GetValueAsString("Anime3", "InfoDelay", "150"); InfoDelay = int.Parse(infodel); string postpct = ""; postpct = xmlreader.GetValueAsString("Anime3", "PosterSizePct", "50"); int tmpPost = 0; int.TryParse(postpct, out tmpPost); if (tmpPost > 0 && tmpPost <= 100) { PosterSizePct = tmpPost; } else { PosterSizePct = 50; } string banpct = ""; banpct = xmlreader.GetValueAsString("Anime3", "BannerSizePct", "50"); int tmpBanner = 0; int.TryParse(banpct, out tmpBanner); if (tmpBanner > 0 && tmpBanner <= 100) { BannerSizePct = tmpBanner; } else { BannerSizePct = 50; } string ffdshowNotificationsShow = ""; ffdshowNotificationsShow = xmlreader.GetValueAsString("Anime3", "FfdshowNotificationsShow", "1"); FfdshowNotificationsShow = ffdshowNotificationsShow == "0" ? false : true; string ffdshowNotificationsAutoClose = ""; ffdshowNotificationsAutoClose = xmlreader.GetValueAsString("Anime3", "FfdshowNotificationsAutoClose", "1"); FfdshowNotificationsAutoClose = ffdshowNotificationsAutoClose == "0" ? false : true; string ffdshowNotificationsLock = ""; ffdshowNotificationsLock = xmlreader.GetValueAsString("Anime3", "FfdshowNotificationsLock", "1"); FfdshowNotificationsLock = ffdshowNotificationsLock == "0" ? false : true; FfdshowNotificationsAutoCloseTime = int.Parse(xmlreader.GetValueAsString("Anime3", "FfdshowNotificationsAutoCloseTime", "3000")); FfdshowNotificationsLockTime = int.Parse(xmlreader.GetValueAsString("Anime3", "FfdshowNotificationsLockTime", "5000")); xmlreader.Dispose(); // parse the list of torrent sources if (TorrentSourcesRaw.Length > 0) { string[] fitems = TorrentSourcesRaw.Split(';'); foreach (string s in fitems) { TorrentSources.Add(s); } } }