internal static void SetProperties(IMeedioItem properties) { //if (properties["MovieTitleLocatorProp"] != null) // Settings.OverrideAutomatedMovieTitleLocator = // (bool) properties["MovieTitleLocatorProp"]; //if (properties["MovieTitleLocationProp"] != null) // Settings.MovieTitleLocationInPath = // (string) properties["MovieTitleLocationProp"]; //if (properties["WantToImportFilmsProp"] != null) // Settings.FilmImporterIsEnabled = (bool)properties["WantToImportFilmsProp"]; //SetMovieDetailsProperties(properties); //if (properties["ExtractMetadataFromFilenamesProp"] != null) // Settings.ExtractMetadataFromFilenames = // (bool) properties["ExtractMetadataFromFilenamesProp"]; if (properties["DebugLogProp"] != null) Settings.WriteDebugLog = (bool) properties["DebugLogProp"]; //if (properties["ImportDvdFoldersProp"] != null) // Settings.ImportDvdFolders = // (bool) properties["ImportDvdFoldersProp"]; }
internal static void SetProperties(IMeedioItem properties) { if (properties["LanguageProp"] != null) Settings.PrimaryLanguage = (string) properties["LanguageProp"]; if (properties["LanguagePropSecondary"] != null) Settings.SecondaryLanguage = (string) properties["LanguagePropSecondary"]; if (properties["FileTypeVerifierProp"] != null) Settings.EnableFileTypeVerifier = (bool)properties["FileTypeVerifierProp"]; if (properties["DebugLogProp"] != null) Settings.EnableDebugLog = (bool) properties["DebugLogProp"]; }
private static void LogPluginSettings (IMeedioItem Properties) { string propertiesString = Properties[0].ToString(); string[] properties = propertiesString.Split('¦'); string pluginPath = Debugger.GetPluginPath(); string debugLogPath = pluginPath + "Debug.log"; DeleteDebugFile(debugLogPath); #region Write Plugin Settings to Debug.log File.AppendAllText(pluginPath + "Debug.log", @"------------------------ START OF PLUGIN SETTINGS ---------------------"); foreach (string property in properties) { File.AppendAllText(pluginPath + "Debug.log", Environment.NewLine); File.AppendAllText(pluginPath + "Debug.log", property); } File.AppendAllText(pluginPath + "Debug.log", Environment.NewLine); File.AppendAllText(pluginPath + "Debug.log", @"------------------------ END OF PLUGIN SETTINGS ---------------------"); File.AppendAllText(pluginPath + "Debug.log", Environment.NewLine); #endregion }
/// <summary> /// Retrieving config settings from configuration.exe and at startup from MeediOSApp /// </summary> /// <PARAM name="properties">Containing the list of settings</PARAM><PARAM name="errorText">Returns the error text</PARAM> /// <returns> /// Returns true on success, false on error. /// </returns> /// /// public bool SetProperties (IMeedioItem Properties, out string errorText) { errorText = null; try { //LogPluginSettings(Properties); PropertiesSetter.SetProperties(Properties); #region MediaFolders MfSettingsMovies = Properties ["AdvancedSettingsFoldersa"].ToString().Trim(); #endregion } catch (Exception ex) { MessageBox.Show (ex.ToString()); return false; } return true; }
internal static void SetProperties (IMeedioItem properties) { //if (properties["MovieTitleLocatorProp"] != null) // Settings.OverrideAutomatedMovieTitleLocator = // (bool) properties["MovieTitleLocatorProp"]; //if (properties["MovieTitleLocationProp"] != null) // Settings.MovieTitleLocationInPath = // (string) properties["MovieTitleLocationProp"]; //if (properties["WantToImportFilmsProp"] != null) // Settings.FilmImporterIsEnabled = (bool)properties["WantToImportFilmsProp"]; //SetMovieDetailsProperties(properties); //if (properties["ExtractMetadataFromFilenamesProp"] != null) // Settings.ExtractMetadataFromFilenames = // (bool) properties["ExtractMetadataFromFilenamesProp"]; if (properties["DebugLogProp"] != null) { Settings.WriteDebugLog = (bool)properties["DebugLogProp"]; } //if (properties["ImportDvdFoldersProp"] != null) // Settings.ImportDvdFolders = // (bool) properties["ImportDvdFoldersProp"]; }
public bool SetProperties(IMeedioItem Properties, out String ErrorText) { ErrorText = ""; try { if (Properties["custom"] != null) { MyProperties.SetProperties(ref Properties, "custom"); } if (Properties["bool"] != null) { boolProperty = (Boolean)Properties["bool"]; } if (Properties["char"] != null) { charProperty = (String)Properties["char"]; } if (Properties["choices"] != null) { choicesProperty = (String)Properties["choices"]; } if (Properties["choices2"] != null) { choices2Property = (String)Properties["choices2"]; } if (Properties["date"] != null) { dateProperty = (String)Properties["date"]; } if (Properties["file"] != null) { fileProperty = (String)Properties["file"]; } if (Properties["float"] != null) { floatProperty = (Single)Properties["float"]; } if (Properties["folder"] != null) { folderProperty = (String)Properties["folderProperty"]; } if (Properties["folderlist"] != null) { folderlistProperty = (String[])Properties["folderlist"]; } if (Properties["int"] != null) { intProperty = (Int32)Properties["int"]; } if (Properties["maskedtextbox"] != null) { maskedtextboxProperty = (String)Properties["maskedtextbox"]; } if (Properties["numericupdown"] != null) { numericupdownProperty = (Single)Properties["numericupdown"]; } if (Properties["password"] != null) { passwordProperty = (String)Properties["password"]; } if (Properties["section"] != null) { sectionProperty = (String)Properties["section"]; } if (Properties["string"] != null) { stringProperty = (String)Properties["string"]; } if (Properties["stringlist"] != null) { stringlistProperty = (String[])Properties["stringlist"]; } if (Properties["time"] != null) { timeProperty = (String)Properties["time"]; } if (Properties["trackbar"] != null) { trackbarProperty = (Int32)Properties["trackbar"]; } } catch (Exception exception) { ErrorText = exception.Message; return false; } return true; }
public bool SetProperties(IMeedioItem Properties, out String ErrorText) { ErrorText = ""; try { if (Properties["PromptForName"] != null) { PromptForName = (bool)Properties["PromptForName"]; } if (Properties["DisplayStatus"] != null) { DisplayStatus = (string)Properties["DisplayStatus"]; } if (Properties["DVDTVOptions"] != null) { DVDTVOptions = (string)Properties["DVDTVOptions"]; } if (Properties["DVDMovieOptions"] != null) { DVDMovieOptions = (string)Properties["DVDMovieOptions"]; } if (Properties["BRTVOptions"] != null) { BRTVOptions = (string)Properties["BRTVOptions"]; } if (Properties["BRMovieOptions"] != null) { BRMovieOptions = (string)Properties["BRMovieOptions"]; } if (Properties["extProgram"] != null) { extProgram = (string)Properties["extProgram"]; } if (Properties["extParameters"] != null) { extParameters = (string)Properties["extParameters"]; } if (Properties["brProgram"] != null) { brProgram = (string)Properties["brProgram"]; } if (Properties["brParameters"] != null) { brParameters = (string)Properties["brParameters"]; } if (Properties["TVDir"] != null) { TVDir = (string[])Properties["TVDir"]; } if (Properties["DvdDir"] != null) { DvdDir = (string[])Properties["DvdDir"]; } if (Properties["BrDir"] != null) { BrDir = (string[])Properties["BrDir"]; } if (Properties["CreateFolder"] != null) { CreateFolder = (string)Properties["CreateFolder"]; } if (Properties["MoviePoster"] != null) { MoviePoster = (string)Properties["MoviePoster"]; } if (Properties["PosterTagDivider"] != null) { PosterTagDivider = (string)Properties["PosterTagDivider"]; } if (Properties["PosterDir"] != null) { PosterDir = (string)Properties["PosterDir"]; } if (Properties["DVDIDDivider"] != null) { DVDIDDivider = (string)Properties["DVDIDDivider"]; } if (Properties["IMDbIDDivider"] != null) { IMDbIDDivider = (string)Properties["IMDbIDDivider"]; } if (Properties["EjectDvd"] != null) { EjectDvd = (bool)Properties["EjectDvd"]; } if (Properties["importTVModule"] != null) { importTVModule = (string)Properties["importTVModule"]; } if (Properties["importModule"] != null) { importModule = (string)Properties["importModule"]; } if (Properties["ImportDelay"] != null) { ImportDelay = (string)Properties["ImportDelay"]; } if (Properties["Log"] != null) { Log = (bool)Properties["Log"]; } if (Properties["HandBrakeQuality"] != null) { HandBrakeQuality = (string)Properties["HandBrakeQuality"]; } if (Properties["DownConvertAudio"] != null) { DownConvertAudio = (bool)Properties["DownConvertAudio"]; } if (Properties["PreferLPCM"] != null) { PreferLPCM = (bool)Properties["PreferLPCM"]; } } catch (Exception exception) { ErrorText = exception.Message; return false; } return true; }
internal static void SetProperties(IMeedioItem properties) { #region [DEPRECATED] Media Importers and Updaters combo if (properties["WantToImportAndUpdateFilmsProp"] != null) Settings.EnableImportAndUpdateFilmsCombo = (bool)properties["WantToImportAndUpdateFilmsProp"]; if (properties["WantToImportAndUpdateMusicProp"] != null) Settings.EnabeImportAndUpdateMusicCombo = (bool)properties["WantToImportAndUpdateMusicProp"]; if (properties["WantToImportAndUpdateTvSeriesProp"] != null) Settings.EnableImportAndUpdateTvSeriesCombo = (bool)properties["WantToImportAndUpdateTvSeriesProp"]; if (properties["WantToImportAndUpdateBooksProp"] != null) Settings.EnableImportAndUpdateBooksCombo = (bool)properties["WantToImportAndUpdateBooksProp"]; if (properties["WantToImportAndUpdateGamesProp"] != null) Settings.EnableImportAndUpdateGamesCombo = (bool)properties["WantToImportAndUpdateGamesProp"]; #endregion if (properties["GameShortcutsProp"] != null) Settings.GameShortcutsLocation = (string) properties["GameShortcutsProp"]; if (properties["WantFilesImportingProp"] != null) MediaImportersAndUpdatersCoreSettings.EnableMediaImporters = (bool) properties["WantFilesImportingProp"]; if (properties["WantMediaUpdatingProp"] != null) MediaImportersAndUpdatersCoreSettings.EnableMediaUpdaters = (bool) properties["WantMediaUpdatingProp"]; #region Media Sources //if (Properties["ImportRootFolderProp"] != null) //{ // Type type = Properties["ImportRootFolderProp"].GetType(); // if (type.Name != "DBNull") // ImportRootFolders = (string[])Properties["ImportRootFolderProp"]; // else // { // ImportRootFolders = new string[1]; // ImportRootFolders[0] = ""; // } //} #endregion if (properties["MovieTitleLocatorProp"] != null) Settings.OverrideAutomatedMovieTitleLocator = (bool) properties["MovieTitleLocatorProp"]; if (properties["MovieTitleLocationProp"] != null) Settings.MovieTitleLocationInPath = (string) properties["MovieTitleLocationProp"]; #region Media Importing if (properties["WantToImportFilmsProp"] != null) MediaImportersAndUpdatersCoreSettings.EnableMovieImporter = (bool) properties["WantToImportFilmsProp"]; if (properties["WantToImportMusicProp"] != null) MediaImportersAndUpdatersCoreSettings.EnableMusicImporter = (bool) properties["WantToImportMusicProp"]; if (properties["WantToImportTvSeriesProp"] != null) MediaImportersAndUpdatersCoreSettings.EnableTvSeriesImporter = (bool) properties["WantToImportTvSeriesProp"]; #endregion if (properties["WantMediaInfoProp"] != null) Settings.MediaInfoIsEnabled = (bool) properties["WantMediaInfoProp"]; #region Film Details if (properties["PopulateIMDbDetailsProp"] != null) Settings.FilmIMDbDetailsDownloaderIsEnabled = (bool) properties["PopulateIMDbDetailsProp"]; if (properties["PopulateOSdbDetailsProp"] != null) Settings.FilmOSDbDetailsDownloaderIsEnabled = (bool) properties["PopulateOSdbDetailsProp"]; //if (properties["PopulateAMGDetailsProp"] != null) // Settings.AllMediaGuideFilmDetailsEnabled // = (bool) properties["PopulateAMGDetailsProp"]; if (properties["PopulateTMDbDetailsProp"] != null) Settings.TMDbFilmDetailsEnabled = (bool) properties["PopulateTMDbDetailsProp"]; //if (properties["PopulateSevenVideoNetDetailsProp"] != null) // Settings.SevenFilmDetailsEnabled = (bool) properties["PopulateSevenVideoNetDetailsProp"]; #endregion #region Film Posters if (properties["DownloadPosterChoice"] != null) Settings.FilmCoverArtDownloaderIsEnabled = (bool) properties["DownloadPosterChoice"]; if (properties["PrimaryPosterSourceChoice"] != null) Settings.PosterPrimarySource = (string) properties["PrimaryPosterSourceChoice"]; //if (Properties["OverwritePosterChoice"] != null) OverwriteExistingPosters = (bool)Properties["OverwritePosterChoice"]; if (properties["PosterSizeChoice"] != null) Settings.PosterSize = (string) properties["PosterSizeChoice"]; //if (Properties["WhereToSavePosterProp"] != null) WhereToSavePoster = (string)Properties["WhereToSavePosterProp"]; //if (Properties["PosterFolderProp"] != null) PosterFolder = (string)Properties["PosterFolderProp"]; //if (Properties["PosterNamingChoice"] != null) //{ // if (WhereToSavePoster == "in the folder i specify below") // { // PosterNamingMethod = "iMDbID"; // } // else // PosterNamingMethod = (string)Properties["PosterNamingChoice"]; //} if (properties["ResizeFilmPostersProp"] != null) Settings.ResizeFilmPosters = (bool) properties["ResizeFilmPostersProp"]; if (properties["FilmPosterWidthProp"] != null) Settings.FilmPosterWidth = (int) properties["FilmPosterWidthProp"]; if (properties["FilmPosterHeightProp"] != null) Settings.FilmPosterHeight = (int) properties["FilmPosterHeightProp"]; #endregion #region Film Backdrops if (properties["DownloadBackdropsChoice"] != null) Settings.FilmBackdropArtDownloaderIsEnabled = (bool) properties["DownloadBackdropsChoice"]; //if (Properties["WhereToSaveBackdropProp"] != null) WhereToSaveBackdrop = (string)Properties["WhereToSaveBackdropProp"]; //if (Properties["BackdropFolderProp"] != null) BackdropFolder = (string)Properties["BackdropFolderProp"]; //if (Properties["BackdropNamingChoice"] != null) BackdropNamingMethod = (string)Properties["BackdropNamingChoice"]; if (properties["ResizeFilmBackdropsProp"] != null) Settings.ResizeFilmBackdrops = (bool) properties["ResizeFilmBackdropsProp"]; if (properties["FilmBackdropWidthProp"] != null) Settings.FilmBackdropWidth = (int) properties["FilmBackdropWidthProp"]; if (properties["FilmBackdropHeightProp"] != null) Settings.FilmBackdropHeight = (int) properties["FilmBackdropHeightProp"]; #endregion if (properties["ConnectionDiagnosticsProp"] != null) Settings.ConnectionDiagnosticsEnabled = (bool) properties["ConnectionDiagnosticsProp"]; if (properties["DisableSourcesProp"] != null) Settings.WantToDisableSources = (bool) properties["DisableSourcesProp"]; if (properties["FileserverDiagnosticsProp"] != null) Settings.WantFileserverDiagnostics = (bool) properties["FileserverDiagnosticsProp"]; if (properties["WantHashingProp"] != null) Settings.EnableVideoHasher = (bool) properties["WantHashingProp"]; if (properties["PrimaryVideoFingerprintMatchingSourceProp"] != null) Settings.PrimaryVideoFingerprintMatchingSource = (string) properties["PrimaryVideoFingerprintMatchingSourceProp"]; #region Library Cleaners if (properties["DeleteMissingProp"] != null) Settings.DeleteMissing = (bool) properties["DeleteMissingProp"]; if (properties["DeleteCoverImageOfMissingMediaFilesProp"] != null) Settings.DeleteCoverImageOfMissingMediaFiles = (bool) properties["DeleteCoverImageOfMissingMediaFilesProp"]; if (properties["DeleteFanartImageOfMissingMediaFilesProp"] != null) Settings.DeleteFanartImageOfMissingMediaFiles = (bool) properties["DeleteFanartImageOfMissingMediaFilesProp"]; if (properties["ClearEmptyFieldsProp"] != null) Settings.CleanEmptyFields = (bool) properties["ClearEmptyFieldsProp"]; if (properties["CleanSelectedFieldsProp"] != null) Settings.CleanSelectedFields = (bool) properties["CleanSelectedFieldsProp"]; if (properties["SelectedFieldsToCleanProp"] != null) Settings.SelectedFieldsToClean = (string) properties["SelectedFieldsToCleanProp"]; #endregion if (properties["EnableChainLinkingProp"] != null) Settings.FilmItemChainLinkerIsEnabled = (bool) properties["EnableChainLinkingProp"]; if (properties["ExtractMetadataFromFilenamesProp"] != null) Settings.ExtractMetadataFromFilenames = (bool) properties["ExtractMetadataFromFilenamesProp"]; #region Media Organizers if (properties["WantSortingFilmsProp"] != null) Settings.WantSortingFilms = (bool) properties["WantSortingFilmsProp"]; if (properties["WantSortingTvShowsProp"] != null) Settings.WantSortingTvShows = (bool) properties["WantSortingTvShowsProp"]; if (properties["WantSortingMusicProp"] != null) Settings.WantSortingMusic = (bool) properties["WantSortingMusicProp"]; if (properties["PromptBeforeMovingProp"] != null) Settings.PromptBeforeMoving = (bool) properties["PromptBeforeMovingProp"]; if (properties["OnlyTaggedForMovingProp"] != null) Settings.OnlyTaggedForMoving = (bool) properties["OnlyTaggedForMovingProp"]; if (properties["SortingDestinationFilmsProp"] != null) Settings.SortingDestinationFilms = (string) properties["SortingDestinationFilmsProp"]; if (properties["SortingDestinationTvShowsProp"] != null) Settings.SortingDestinationTvShows = (string) properties["SortingDestinationTvShowsProp"]; if (properties["SortingDestinationMusicProp"] != null) Settings.SortingDestinationMusic = (string) properties["SortingDestinationMusicProp"]; if (properties["DirectoryTagMaskFilmsProp"] != null) Settings.DirectoryTagMaskFilms = (string) properties["DirectoryTagMaskFilmsProp"]; if (properties["DirectoryTagMaskTvShowsProp"] != null) Settings.DirectoryTagMaskTvShows = (string) properties["DirectoryTagMaskTvShowsProp"]; if (properties["DirectoryTagMaskMusicProp"] != null) Settings.DirectoryTagMaskMusic = (string) properties["DirectoryTagMaskMusicProp"]; if (properties["DirectoryStructureProp"] != null) Settings.DirectoryStructure = (string) properties["DirectoryStructureProp"]; #endregion if (properties["AssistModeProp"] != null) Settings.AssistType = (string) properties["AssistModeProp"]; if (properties["DurationMatchingProp"] != null) Settings.EnableDurationMatching = (bool) properties["DurationMatchingProp"]; //if (Properties["LimitFilesToImportProp"] != null) importing_limit = (int)Properties["LimitFilesToImportProp"]; #region Media Sections if (properties["FilmsLibraryProp"] != null) Settings.FilmsLibrary = (string) properties["FilmsLibraryProp"]; if (properties["TvShowsLibraryProp"] != null) Settings.TvShowsLibrary = (string) properties["TvShowsLibraryProp"]; if (properties["TvSeriesLibraryProp"] != null) Settings.MusicLibrary = (string) properties["MusicLibraryProp"]; if (properties["NewsLibraryProp"] != null) Settings.NewsLibrary = (string) properties["NewsLibraryProp"]; #endregion //if (properties["WantMusicDNSProp"] != null) // Settings.MusicDNSAudioTrackIdentifierIsEnabled // = (bool) properties["WantMusicDNSProp"]; if (properties["WantAudioTagsProp"] != null) Settings.WantAudioTags = (bool) properties["WantAudioTagsProp"]; //if (properties["SaveMetadataToAudioTagsProp"] != null) // Settings.SaveMetadataToAudioTags // = (bool) properties["SaveMetadataToAudioTagsProp"]; #region Media Updaters if (properties["UpdateMoviesProp"] != null) Settings.EnableMoviesSectionUpdater = (bool) properties["UpdateMoviesProp"]; if (properties["UpdateTvShowsProp"] != null) Settings.EnableTvShowsSectionUpdater = (bool) properties["UpdateTvShowsProp"]; if (properties["UpdateMusicProp"] != null) Settings.EnableMusicSectionUpdater = (bool) properties["UpdateMusicProp"]; #endregion if (properties["EnableUIProp"] != null) Settings.AlwaysPromptForImages = (bool) properties["EnableUIProp"]; if (properties["DebugLogProp"] != null) Settings.WriteDebugLog = (bool) properties["DebugLogProp"]; if (properties["EnableNfoParsingProp"] != null) Settings.EnableNfoParsing = (bool) properties["EnableNfoParsingProp"]; if (properties["WantMatchingProp"] != null) Settings.FilmTitleMatchingEnginesAreEnabled = (bool) properties["WantMatchingProp"]; if (properties["PrimaryFilmIdentificationMethodProp"] != null) Settings.PrimaryFilmIdentificationMethod = (string) properties["PrimaryFilmIdentificationMethodProp"]; if (properties["PrimaryFilmTitleMatchingEngineProp"] != null) Settings.PrimaryFilmTitleMatchingEngine = (string)properties["PrimaryFilmTitleMatchingEngineProp"]; if (properties["PrimaryImdbFilmTitleMatchingEngineProp"] != null) Settings.PrimaryIMDbFilmTitleMatchingEngine = (string) properties["PrimaryImdbFilmTitleMatchingEngineProp"]; if (properties["WriteFilmDescriptorsProp"] != null) Settings.FilmDescriptorsAreEnabled = (bool) properties["WriteFilmDescriptorsProp"]; if (properties["FilmDescriptorConventionProp"] != null) Settings.FilmDescriptorConvention = (string) properties["FilmDescriptorConventionProp"]; if (properties["SimpleWantFilmDetailsProp"] != null) Settings.SimpleFilmDetailsDownloaderIsEnabled = (bool) properties["SimpleWantFilmDetailsProp"]; if (Settings.SimpleFilmDetailsDownloaderIsEnabled) { if (!Settings.FilmIMDbDetailsDownloaderIsEnabled && !Settings.FilmOSDbDetailsDownloaderIsEnabled) { Settings.FilmIMDbDetailsDownloaderIsEnabled = true; Settings.FilmOSDbDetailsDownloaderIsEnabled = true; } } if (!Settings.SimpleFilmDetailsDownloaderIsEnabled) { if (Settings.FilmIMDbDetailsDownloaderIsEnabled || Settings.FilmOSDbDetailsDownloaderIsEnabled) { Settings.FilmIMDbDetailsDownloaderIsEnabled = false; Settings.FilmOSDbDetailsDownloaderIsEnabled = false; } } if (properties["WantAlbumCoversProp"] != null) Settings.WantAlbumCovers = (bool) properties["WantAlbumCoversProp"]; //if (properties["WantArtistBackdropsProp"] != null) // Settings.ArtistBackdropsEnabled = (bool) properties["WantArtistBackdropsProp"]; //if (Properties["EnableMediaDetectionProp"] != null) EnableMediaDetection = (bool)Properties["EnableMediaDetectionProp"]; //if (Properties["FilmsFolderProp"] != null) FilmsFolders = (string[])Properties["FilmsFolderProp"]; //if (Properties["TvShowsFolderProp"] != null) TvShowsFolders = (string[])Properties["TvShowsFolderProp"]; if (properties["RescanFilesNotFoundInLibraryProp"] != null) Settings.RescanFilesNotFoundInLibrary = (bool) properties["RescanFilesNotFoundInLibraryProp"]; if (properties["EmbedAlbumCoverProp"] != null) Settings.EmbedAlbumCover = (bool) properties["EmbedAlbumCoverProp"]; if (properties["WantEpisodeDetailsProp"] != null) Settings.WantEpisodeDetails = (bool) properties["WantEpisodeDetailsProp"]; if (properties["WantEpisodeThumbnailsProp"] != null) Settings.WantEpisodeThumbnails = (bool) properties["WantEpisodeThumbnailsProp"]; if (properties["WantSeriesBannersProp"] != null) Settings.WantSeriesBanners = (bool) properties["WantSeriesBannersProp"]; if (properties["WantSeriesBackdropsProp"] != null) Settings.WantSeriesBackdrops = (bool) properties["WantSeriesBackdropsProp"]; if (properties["WantSeasonImagesProp"] != null) Settings.WantSeasonImages = (bool) properties["WantSeasonImagesProp"]; if (properties["ImportDateCreatedProp"] != null) Settings.ImportDateCreated = (bool) properties["ImportDateCreatedProp"]; if (properties["ImportDateModifiedProp"] != null) Settings.ImportDateModified = (bool) properties["ImportDateModifiedProp"]; if (properties["ImportDateImportedProp"] != null) Settings.ImportDateImported = (bool) properties["ImportDateImportedProp"]; if (properties["TMDbPostersEnabledProp"] != null) Settings.TMDbPostersEnabled = (bool) properties["TMDbPostersEnabledProp"]; if (properties["IMDbPostersEnabledProp"] != null) Settings.IMDbPostersEnabled = (bool) properties["IMDbPostersEnabledProp"]; if (properties["ImpAwardsPostersEnabledProp"] != null) Settings.ImpAwardsPostersEnabled = (bool) properties["ImpAwardsPostersEnabledProp"]; //if (properties["MovieNightCompatibleProp"] != null) // Settings.MovieNightCompatibility // = (bool) properties["MovieNightCompatibleProp"]; if (properties["ImportDvdFoldersProp"] != null) Settings.ImportDvdFolders = (bool) properties["ImportDvdFoldersProp"]; if (properties["ImportDvdImagesProp"] != null) Settings.ImportDvdImages = (bool) properties["ImportDvdImagesProp"]; if (properties["ImportBluRayImagesProp"] != null) Settings.ImportBluRayImages = (bool) properties["ImportBluRayImagesProp"]; if (properties["ImportRarFilmsProp"] != null) Settings.ImportFilmsInRarArchives = (bool) properties["ImportRarFilmsProp"]; if (properties["WantToImportNewsProp"] != null) Settings.EnableRssImporter = (bool) properties["WantToImportNewsProp"]; if (properties["RssFeedsProp"] != null) Settings.RsSfeeds = (string[]) properties["RssFeedsProp"]; if (properties["DownloadFeedImagesProp"] != null) Settings.DownloadRsSimages = (bool) properties["DownloadFeedImagesProp"]; if (properties["RSSimagesLocationProp"] != null) Settings.RSSimagesLocation = (string) properties["RSSimagesLocationProp"]; #region Offline Media Mode //if (properties["OfflineModeProp"] != null) // Settings.OfflineMediaMode = (bool)properties["OfflineModeProp"]; //if (properties["IdentifyDVDfilmsProp"] != null) // Settings.DvdMovieOptions = (bool)properties["IdentifyDVDfilmsProp"]; //if (properties["IdentifyDVDseriesProp"] != null) // Settings.DVDTVOptions = (bool)properties["IdentifyDVDseriesProp"]; //if (properties["IdentifyBRfilmsProp"] != null) // Settings.BRMovieOptions = (bool)properties["IdentifyBRfilmsProp"]; //if (properties["IdentifyBRseriesProp"] != null) // Settings.BRTVOptions = (bool)properties["IdentifyBRseriesProp"]; //if (properties["DriveProp"] != null) Settings.DvdDrive = (string)properties["DriveProp"]; //if (properties["EjectDriveProp"] != null) Settings.EjectDvd = (bool)properties["EjectDriveProp"]; #endregion if (properties["MeePopupProviderCompatibilityProp"] != null) Settings.MeePopupProviderCompatibility = (bool) properties["MeePopupProviderCompatibilityProp"]; }
internal static void SetPluginProperties(CORE.FileImporter fileImporter, IMeedioItem properties) { if (properties["ImporterSettings"] != null) { CustomProperty.SetProperties(properties, "ImporterSettings"); } if ((properties["RootFolders2"] != null) && !(properties["RootFolders2"] is DBNull)) { fileImporter.RootFolders = (string[]) properties["RootFolders2"]; fileImporter.LogMessages.Enqueue( new LogMessage("debug", "RootFolders: " + String.Join(Environment.NewLine, fileImporter.RootFolders))); } if ((properties["RootFolders"] != null) && !(properties["RootFolders"] is DBNull)) { if (fileImporter.RootFolders == null) { fileImporter.RootFolders = (string[]) properties["RootFolders"]; for (int rootFolderPos = 0; rootFolderPos < fileImporter.RootFolders.Length; rootFolderPos++) { fileImporter.RootFolders[rootFolderPos] = fileImporter.RootFolders[rootFolderPos].ToLowerInvariant(); } fileImporter.LogMessages.Enqueue( new LogMessage( "debug", "RootFolders: " + String.Join(Environment.NewLine, fileImporter.RootFolders))); } else { List<string> rootFoldersList = new List<string>(fileImporter.RootFolders); rootFoldersList.AddRange((string[]) properties["RootFolders"]); fileImporter.RootFolders = new string[rootFoldersList.Select(rf => rf.ToLowerInvariant()).Distinct().Count()]; rootFoldersList.Select(rf => rf.ToLowerInvariant()).Distinct().ToArray().CopyTo( fileImporter.RootFolders, 0); fileImporter.LogMessages.Enqueue( new LogMessage( "debug", "RootFolders: " + String.Join(Environment.NewLine, fileImporter.RootFolders))); } } fileImporter.TagMasks = new List<TagMask>(); if ((properties["TagMasks"] != null) && !(properties["TagMasks"] is DBNull)) { fileImporter.TagMasksStrings = (string[]) properties["TagMasks"]; fileImporter.LogMessages.Enqueue(new LogMessage("debug", "TagMasks:")); foreach (string tagMask in fileImporter.TagMasksStrings) { fileImporter.TagMasks.Add(new TagMask(tagMask ?? String.Empty)); fileImporter.LogMessages.Enqueue( new LogMessage("debug", " Mask: " + fileImporter.TagMasks[fileImporter.TagMasks.Count - 1].Mask)); fileImporter.LogMessages.Enqueue( new LogMessage("debug", " RegEx: " + fileImporter.TagMasks[fileImporter.TagMasks.Count - 1].RegExp)); } } if ((properties["ChainFiles"] != null) && !(properties["ChainFiles"] is DBNull)) { fileImporter.ChainFiles = (bool) properties["ChainFiles"]; } if ((properties["ChainingOptions"] != null) && !(properties["ChainingOptions"] is DBNull)) { fileImporter.ChainingOption = (ChainOption) Convert.ToInt32((string) properties["ChainingOptions"]); } if ((properties["ChainingTags"] != null) && !(properties["ChainingTags"] is DBNull)) { fileImporter.TagsToChainBy = (string[]) properties["ChainingTags"]; } if ((properties["DeleteNonExistentFiles"] != null) && !(properties["DeleteNonExistentFiles"] is DBNull)) { fileImporter.DeleteNonExistentFiles = (bool) properties["DeleteNonExistentFiles"]; } if ((properties["AlwaysUpdate"] != null) && !(properties["AlwaysUpdate"] is DBNull)) { fileImporter.AlwaysUpdate = (bool) properties["AlwaysUpdate"]; } fileImporter.TagValuesReplacementRules = new ReplacementRules(properties["TagValuesReplacement"] as string[]); if ((properties["IncludeFileMasks"] != null) && !(properties["IncludeFileMasks"] is DBNull)) { fileImporter.IncludeFileMasks = (string) properties["IncludeFileMasks"]; } if (String.IsNullOrEmpty(fileImporter.IncludeFileMasks)) { fileImporter.IncludeFileMasks = "*.*"; } if ((properties["ExcludeFileMasks"] != null) && !(properties["ExcludeFileMasks"] is DBNull)) { fileImporter.ExcludeFileMasks = (string) properties["ExcludeFileMasks"]; } if ((properties["IncludeHiddenFiles"] != null) && !(properties["IncludeHiddenFiles"] is DBNull)) { fileImporter.IncludeHiddenFiles = (bool) properties["IncludeHiddenFiles"]; } if ((properties["ExcludeUnmatchedFiles"] != null) && !(properties["ExcludeUnmatchedFiles"] is DBNull)) { fileImporter.ExcludeUnmatchedFiles = (bool) properties["ExcludeUnmatchedFiles"]; } if ((properties["MinFileSize"] != null) && !(properties["MinFileSize"] is DBNull)) { fileImporter.MinFileSize = (int) properties["MinFileSize"]; } fileImporter.ImageLinker.ImageSearches.Clear(); var iso = new ImageSearchOptions(); bool addThisImageSearch = false; if ((properties["ImageFileMasks"] != null) && !(properties["ImageFileMasks"] is DBNull)) { var imageFileMasks = (string) properties ["ImageFileMasks"]; if (imageFileMasks.Contains(':')) { iso.ImageFolderSearchPattern = imageFileMasks.Split(new[] {':'})[0]; iso.FileFolderSearchPattern = imageFileMasks.Split(new[] {':'})[1]; } else { iso.ImageFolderSearchPattern = imageFileMasks; iso.FileFolderSearchPattern = imageFileMasks; } } if ((properties["ImageFolder"] != null) && !(properties["ImageFolder"] is DBNull)) { iso.ImageFolder = (string) properties["ImageFolder"]; } if ((properties["FileFolderImage"] != null) && !(properties["FileFolderImage"] is DBNull)) { iso.SearchFileFolderOptions = (string) properties["FileFolderImage"]; fileImporter.ImportImages = !String.IsNullOrEmpty(iso.ImageFolder) || iso.SearchFileFolderOptions != "Never".Translate(); addThisImageSearch = !String.IsNullOrEmpty(iso.ImageFolder) || iso.SearchFileFolderOptions != "Never".Translate(); } if ((properties["ImageCount"] != null) && !(properties["ImageCount"] is DBNull)) { iso.MaxImages = (int) properties["ImageCount"]; } if ((properties["ImageTagName"] != null) && !(properties["ImageTagName"] is DBNull)) { iso.ImageTagName = (string) properties["ImageTagName"]; } if ((properties["AlwaysUpdateImages"] != null) && !(properties["AlwaysUpdateImages"] is DBNull)) { fileImporter.alwaysUpdateImages = (bool) properties["AlwaysUpdateImages"]; } if ((properties["SaveInImageBaseTag"] != null) && !(properties["SaveInImageBaseTag"] is DBNull)) { iso.SaveInImageBaseTag = (bool) properties["SaveInImageBaseTag"]; } if (addThisImageSearch) { fileImporter.ImageLinker.ImageSearches.Add(iso); } bool doNextImageSearch = false; if ((properties["ImageSearchActive2"] != null) && !(properties["ImageSearchActive2"] is DBNull)) { doNextImageSearch = (bool) properties["ImageSearchActive2"]; } if (doNextImageSearch) { iso = new ImageSearchOptions(); if ((properties["ImageFileMasks2"] != null) && !(properties["ImageFileMasks2"] is DBNull)) { string imageFileMasks = (string) properties["ImageFileMasks2"]; if (imageFileMasks.Contains(':')) { iso.ImageFolderSearchPattern = imageFileMasks.Split(new[] {':'})[0]; iso.FileFolderSearchPattern = imageFileMasks.Split(new[] {':'})[1]; } else { iso.ImageFolderSearchPattern = imageFileMasks; iso.FileFolderSearchPattern = imageFileMasks; } } if ((properties["ImageFolder2"] != null) && !(properties["ImageFolder2"] is DBNull)) { iso.ImageFolder = (string) properties["ImageFolder2"]; } if ((properties["FileFolderImage2"] != null) && !(properties["FileFolderImage2"] is DBNull)) { iso.SearchFileFolderOptions = (string) properties["FileFolderImage2"]; addThisImageSearch = !String.IsNullOrEmpty(iso.ImageFolder) || iso.SearchFileFolderOptions != "Never".Translate(); fileImporter.ImportImages = fileImporter.ImportImages || addThisImageSearch; } if ((properties["ImageCount2"] != null) && !(properties["ImageCount2"] is DBNull)) { iso.MaxImages = (int) properties["ImageCount2"]; } if ((properties["ImageTagName2"] != null) && !(properties["ImageTagName2"] is DBNull)) { iso.ImageTagName = (string) properties["ImageTagName2"]; } if ((properties["SaveInImageBaseTag2"] != null) && !(properties["SaveInImageBaseTag2"] is DBNull)) { iso.SaveInImageBaseTag = (bool) properties["SaveInImageBaseTag2"]; } if (addThisImageSearch) { fileImporter.ImageLinker.ImageSearches.Add(iso); } } if ((properties["ImageSearchActive3"] != null) && !(properties["ImageSearchActive3"] is DBNull)) { doNextImageSearch = (bool) properties["ImageSearchActive3"]; } if (doNextImageSearch) { iso = new ImageSearchOptions(); if ((properties["ImageFileMasks3"] != null) && !(properties["ImageFileMasks3"] is DBNull)) { string imageFileMasks = (string) properties["ImageFileMasks3"]; if (imageFileMasks.Contains(':')) { iso.ImageFolderSearchPattern = imageFileMasks.Split(new[] {':'})[0]; iso.FileFolderSearchPattern = imageFileMasks.Split(new[] {':'})[1]; } else { iso.ImageFolderSearchPattern = imageFileMasks; iso.FileFolderSearchPattern = imageFileMasks; } } if ((properties["ImageFolder3"] != null) && !(properties["ImageFolder3"] is DBNull)) { iso.ImageFolder = (string) properties["ImageFolder3"]; } if ((properties["FileFolderImage3"] != null) && !(properties["FileFolderImage3"] is DBNull)) { iso.SearchFileFolderOptions = (string) properties["FileFolderImage3"]; addThisImageSearch = fileImporter.ImportImages || !String.IsNullOrEmpty(iso.ImageFolder) || iso.SearchFileFolderOptions != "Never".Translate(); fileImporter.ImportImages = fileImporter.ImportImages || addThisImageSearch; } if ((properties["ImageCount3"] != null) && !(properties["ImageCount3"] is DBNull)) { iso.MaxImages = (int) properties["ImageCount3"]; } if ((properties["ImageTagName3"] != null) && !(properties["ImageTagName3"] is DBNull)) { iso.ImageTagName = (string) properties["ImageTagName3"]; } if ((properties["SaveInImageBaseTag3"] != null) && !(properties["SaveInImageBaseTag3"] is DBNull)) { iso.SaveInImageBaseTag = (bool) properties["SaveInImageBaseTag3"]; } if (addThisImageSearch) { fileImporter.ImageLinker.ImageSearches.Add(iso); } } if ((properties["ImageSearchActive4"] != null) && !(properties["ImageSearchActive4"] is DBNull)) { doNextImageSearch = (bool) properties["ImageSearchActive4"]; } if (doNextImageSearch) { iso = new ImageSearchOptions(); if ((properties["ImageFileMasks4"] != null) && !(properties["ImageFileMasks4"] is DBNull)) { string imageFileMasks = (string) properties["ImageFileMasks4"]; if (imageFileMasks.Contains(':')) { iso.ImageFolderSearchPattern = imageFileMasks.Split(new[] {':'})[0]; iso.FileFolderSearchPattern = imageFileMasks.Split(new[] {':'})[1]; } else { iso.ImageFolderSearchPattern = imageFileMasks; iso.FileFolderSearchPattern = imageFileMasks; } } if ((properties["ImageFolder4"] != null) && !(properties["ImageFolder4"] is DBNull)) { iso.ImageFolder = (string) properties["ImageFolder4"]; } if ((properties["FileFolderImage4"] != null) && !(properties["FileFolderImage4"] is DBNull)) { iso.SearchFileFolderOptions = (string) properties["FileFolderImage4"]; addThisImageSearch = fileImporter.ImportImages || !String.IsNullOrEmpty(iso.ImageFolder) || iso.SearchFileFolderOptions != "Never".Translate(); fileImporter.ImportImages = fileImporter.ImportImages || addThisImageSearch; } if ((properties["ImageCount4"] != null) && !(properties["ImageCount4"] is DBNull)) { iso.MaxImages = (int) properties["ImageCount4"]; } if ((properties["ImageTagName4"] != null) && !(properties["ImageTagName4"] is DBNull)) { iso.ImageTagName = (string) properties["ImageTagName4"]; } if ((properties["SaveInImageBaseTag4"] != null) && !(properties["SaveInImageBaseTag4"] is DBNull)) { iso.SaveInImageBaseTag = (bool) properties["SaveInImageBaseTag4"]; } if (addThisImageSearch) { fileImporter.ImageLinker.ImageSearches.Add(iso); } } if ((properties["ImageSearchActive5"] != null) && !(properties["ImageSearchActive5"] is DBNull)) { doNextImageSearch = (bool) properties["ImageSearchActive5"]; } if (doNextImageSearch) { iso = new ImageSearchOptions(); if ((properties["ImageFileMasks5"] != null) && !(properties["ImageFileMasks5"] is DBNull)) { string imageFileMasks = (string) properties["ImageFileMasks5"]; if (imageFileMasks.Contains(':')) { iso.ImageFolderSearchPattern = imageFileMasks.Split(new[] {':'})[0]; iso.FileFolderSearchPattern = imageFileMasks.Split(new[] {':'})[1]; } else { iso.ImageFolderSearchPattern = imageFileMasks; iso.FileFolderSearchPattern = imageFileMasks; } } if ((properties["ImageFolder5"] != null) && !(properties["ImageFolder5"] is DBNull)) { iso.ImageFolder = (string) properties["ImageFolder5"]; } if ((properties["FileFolderImage5"] != null) && !(properties["FileFolderImage5"] is DBNull)) { iso.SearchFileFolderOptions = (string) properties["FileFolderImage5"]; addThisImageSearch = fileImporter.ImportImages || !String.IsNullOrEmpty(iso.ImageFolder) || iso.SearchFileFolderOptions != "Never".Translate(); fileImporter.ImportImages = fileImporter.ImportImages || addThisImageSearch; } if ((properties["ImageCount5"] != null) && !(properties["ImageCount5"] is DBNull)) { iso.MaxImages = (int) properties["ImageCount5"]; } if ((properties["ImageTagName5"] != null) && !(properties["ImageTagName5"] is DBNull)) { iso.ImageTagName = (string) properties["ImageTagName5"]; } if ((properties["SaveInImageBaseTag5"] != null) && !(properties["SaveInImageBaseTag5"] is DBNull)) { iso.SaveInImageBaseTag = (bool) properties["SaveInImageBaseTag5"]; } if (addThisImageSearch) { fileImporter.ImageLinker.ImageSearches.Add(iso); } } /* if (properties["FollowShortcuts"] != null) { FollowShortcuts = (Boolean)properties["FollowShortcuts"]; } */ if ((properties["FileSizeTagName"] != null) && !(properties["FileSizeTagName"] is DBNull)) { fileImporter.FileSizeTagName = (string) properties["FileSizeTagName"]; fileImporter.FileSize = fileImporter.FileSizeTagName.Length > 0; } if ((properties["CreationDateTagName"] != null) && !(properties["CreationDateTagName"] is DBNull)) { fileImporter.CreationDateTagName = (string) properties["CreationDateTagName"]; fileImporter.CreationDate = fileImporter.CreationDateTagName.Length > 0; } if ((properties["LastModificationDateTagName"] != null) && !(properties["LastModificationDateTagName"] is DBNull)) { fileImporter.LastModificationDateTagName = (string) properties["LastModificationDateTagName"]; fileImporter.LastModificationDate = fileImporter.LastModificationDateTagName.Length > 0; } if ((properties["LastAccessDateTagName"] != null) && !(properties["LastAccessDateTagName"] is DBNull)) { fileImporter.LastAccessDateTagName = (string) properties["LastAccessDateTagName"]; fileImporter.LastAccessDate = fileImporter.LastAccessDateTagName.Length > 0; } if ((properties["SerialNumberTagName"] != null) && !(properties["SerialNumberTagName"] is DBNull)) { fileImporter.SerialNumberTagName = (string) properties["SerialNumberTagName"]; fileImporter.SerialNumber = fileImporter.SerialNumberTagName.Length > 0; } /* if (properties["DiscIDTagName"] != null) { DiscIDTagName = (string)properties["DiscIDTagName"]; } */ if ((properties["VolumeNameTagName"] != null) && !(properties["VolumeNameTagName"] is DBNull)) { fileImporter.VolumeNameTagName = (string) properties["VolumeNameTagName"]; fileImporter.VolumeName = fileImporter.VolumeNameTagName.Length > 0; } if ((properties["SingleFilename"] != null) && !(properties["SingleFilename"] is DBNull)) { fileImporter.SingleFilename = (string) properties["SingleFilename"]; } if (!String.IsNullOrEmpty(fileImporter.SingleFilename)) { fileImporter.RootFolders = new[] {Path.GetDirectoryName(fileImporter.SingleFilename)}; fileImporter.IncludeFileMasks = String.Empty; fileImporter.IncludeFileMasks = Path.GetFileName(fileImporter.SingleFilename); } if ((properties["ImportFromADS"] != null) && !(properties["ImportFromADS"] is DBNull)) { fileImporter.ImportFromAlternateDataStream = (bool) properties["ImportFromADS"]; } if ((properties["ExportToADS"] != null) && !(properties["ExportToADS"] is DBNull)) { fileImporter.ExportToAlternateDataStream = (bool) properties["ExportToADS"]; } if ((properties["DebugLevel"] != null) && !(properties["DebugLevel"] is DBNull)) { fileImporter.DebugLevel = (string) properties["DebugLevel"]; } }
/// <summary> /// Retrieving config settings from configuration.exe and at startup from MeediOSApp /// </summary> /// <PARAM name="properties">Containing the list of settings</PARAM><PARAM name="errorText">Returns the error text</PARAM> /// <returns> /// Returns true on success, false on error. /// </returns> public bool SetProperties(IMeedioItem properties, out string errorText) { errorText = null; try { PropertiesSetter.SetProperties(properties); } catch (Exception ex) { MessageBox.Show(ex.ToString()); return false; } return true; }
/// <summary> /// Retrieving config settings from configuration.exe and at startup from MeediOSApp /// </summary> /// <PARAM name="properties">Containing the list of settings</PARAM><PARAM name="errorText">Returns the error text</PARAM> /// <returns> /// Returns true on success, false on error. /// </returns> public bool SetProperties(IMeedioItem Properties, out string errorText) { errorText = null; try { if (Properties["customAdvancedOptions"] != null) { CustomProperty.SetProperties(Properties, "customAdvancedOptions"); } //for (int i = 0; i < Properties.Count; i++ ) //{ string propertiesString = Properties[0].ToString(); string[] properties = propertiesString.Split('¦'); string pluginPath = Debugger.GetPluginPath(); string debugLogPath = pluginPath + "Debug.log"; #region Delete debug.log try { File.Delete(debugLogPath); } catch (Exception e) { Debugger.LogMessageToFile( "An error occured while trying to delete the debug log file. The error was: " + e); } #endregion #region Write Plugin Settings to Debug.log File.AppendAllText(pluginPath + "Debug.log", @"------------------------ START OF PLUGIN SETTINGS ---------------------"); foreach (string property in properties) { File.AppendAllText(pluginPath + "Debug.log", Environment.NewLine); File.AppendAllText(pluginPath + "Debug.log", property); } File.AppendAllText(pluginPath + "Debug.log", Environment.NewLine); File.AppendAllText(pluginPath + "Debug.log", @"------------------------ END OF PLUGIN SETTINGS ---------------------"); File.AppendAllText(pluginPath + "Debug.log", Environment.NewLine); #endregion PropertiesSetter.SetProperties(Properties); #region MediaFolders and MetadataFolders MfSettingsMovies = Properties["AdvancedSettingsFolders"].ToString().Trim(); MfSettingsTvShows = Properties["AdvancedSettingsFoldersb"].ToString().Trim(); MfSettingsMusic = Properties["AdvancedSettingsFoldersc"].ToString().Trim(); MdfSettingsa = Properties["AdvancedSettingsMovies"].ToString().Trim(); MdfSettingsb = Properties["AdvancedSettingsTVShows"].ToString().Trim(); MdfSettingsc = Properties["AdvancedSettingsMusic"].ToString().Trim(); #endregion } catch (Exception ex) { MessageBox.Show(ex.ToString()); return false; } return true; }
public bool SetProperties(IMeedioItem Properties, out string ErrorText) { ErrorText = String.Empty; return true; }
public bool SetProperties(IMeedioItem properties, out string errorText) { errorText = string.Empty; if (!this.Initialized) { errorText = "FileImporter didn't initialize correctly." + Environment.NewLine + "The error should have been logged to the SystemLog." + Environment.NewLine + "If you want this error fixed, please send me the SystemLog via pm or mail."; return false; } try { PluginPropertiesSetter.SetPluginProperties(this, properties); } catch (Exception ex) { errorText = ex.ToString(); return false; } return true; }