private static void RetrieveFilmFolders(Importer importer)
        {
            try
                    {

                        Settings.FilmsFolders = MediaFolders.API.Folders
                            (importer.Ibs, importer.MfSettingsMovies).Split
                            (new[] {'|'}, StringSplitOptions.None);

                    }
                    catch (Exception e)
                    {

                        // ReSharper disable LocalizableElement
                        MessageBox.Show(
                            "The media importing engine was unable to retrieve" +
                            " the directories containing your Movies media files. " +
                            "Please make sure that you have provided your media locations" +
                            "for this type of your media files in the plugin's" +
                            " 'Media Folders' settings group and try again.",
                            "Movies Media Folders were not specified", MessageBoxButtons.OK);
                        // ReSharper restore LocalizableElement

                        Debugger.LogMessageToFile("[Media Importing Engine] Unable to retrieve" +
                                                  " user's media files locations." +
                                                  "The error was: " + Environment.NewLine + e);

                    }
        }
        protected internal static void ScanDiskForEntertainmentMedia(IEnumerable<string> combinedSceneTags,
             string[] videoExtensions,
             string[] audioExtensions,
             string pluginpath,
             string[] filmLocations,
             ArrayList extensionsToIgnore,
             IEnumerable<string> videoExtensionsCommon, 
             Importer importer,
             IMLSection section)
        {
            ImportingEngineHelpers
                .BeginUpdatingSections
                (section);

            extensionsToIgnore
                = ScanDiskForMovies
                (combinedSceneTags,
                videoExtensions,
                audioExtensions,
                filmLocations,
                extensionsToIgnore,
                videoExtensionsCommon,
                importer,
                section);

            MediaImportingEngineHelpers
                .WriteNonMediaExtensionsToFile
                (extensionsToIgnore, pluginpath);

            ImportingEngineHelpers
                .EndUpdatingSections
                (section);
        }
        public static bool DoImport(Importer importer,
                     IBaseSystem iBaseSystem,
                     IMLSection section,
                     IMLImportProgress progress)
        {
            try
                    {

                        ThisProgress = progress;
                        Settings.ImportingStarted = false;
                        Settings.ImportingCompleted = false;

                        MediaLocationsRetriever
                            .RetrieveMediaLocations
                            (importer);

                        if (ImportingEngineHelpers
                            .PerformInitializationTasks(section))
                            return true;

                        var combinedSceneTags =
                            VideoFilenameCleaner
                            .ReadDictionaryReturnAllTags();

                        StartMainImportingEngine
                            (importer,
                             iBaseSystem,
                             section,
                             combinedSceneTags);

                        ImportingEngineHelpers
                            .FinishImport();

                        return true;

                    }
                    catch (Exception e)
                    {

                        Debugger.LogMessageToFile
                            ("An unexpected error ocurred " +
                             "in the main import method DoImport(). " +
                             "The error was: " + e);
                    }

                    return true;
        }
        protected internal static void RetrieveMediaLocations(Importer importer)
        {
            Helpers.UpdateProgress
                    ("","Retrieving media locations...");

                Debugger.LogMessageToFile(
                    "Retrieving media locations...");

                string filmsMediaFolder
                    =  MediaFolders.API.Folders
                    (importer.Ibs, importer.MfSettingsMovies);

            string importRootFoldersStr = filmsMediaFolder;

                Settings.RootMediaFolders =
                    importRootFoldersStr.Split(new[] { '|' },
                    StringSplitOptions.None);

                RetrieveFilmFolders(importer);
        }
        private static ArrayList ScanDiskForMovies(IEnumerable<string> combinedSceneTags,
             string[] videoExtensions,
             string[] audioExtensions,
             string[] filmLocations,
             ArrayList extensionsToIgnore,
             IEnumerable<string> videoExtensionsCommon,
             Importer importer, IMLSection section)
        {
            DirectoryScanner.ScanMediaDirectories
                (Settings.FilmsFolders,
                 ref extensionsToIgnore,
                 filmLocations,
                 videoExtensions,
                 audioExtensions,
                 combinedSceneTags,
                 videoExtensionsCommon,
                 importer, section);

            return extensionsToIgnore;
        }
        public static void ImportMediaFilesMain(IEnumerable<string> combinedSceneTags,
                    Importer importer, IMLSection section)
        {
            string pluginpath;

                    FileInfo[] mediaSnapshotsFI =
                        MediaImportingEngineHelpers.LoadMediaSnapshots
                        (out pluginpath);

                    Debugger.LogMessageToFile
                            ("Media File Importer is enabled.");

                    if (Settings.RootMediaFolders == null
                        || Settings.RootMediaFolders.Length == 0)
                    {
                        return;
                    }

                    #region Declare Vars
                    string[] filmLocations;
                    string[] musicLocations;
                    string[] tvShowsLocations;

                    ArrayList extensionsToIgnore;
                    string[] videoExtensions;
                    string[] videoExtensionsCommon;
                    string[] audioExtensions;
                    #endregion

                    MediaImportingEngineHelpers.PerformPreImportCaching
                        (mediaSnapshotsFI, pluginpath, out filmLocations,
                        out extensionsToIgnore, out videoExtensions,
                        out audioExtensions, out videoExtensionsCommon,
                        section);

                    DiskMediaScanInitiator.ScanDiskForEntertainmentMedia
                        (combinedSceneTags, videoExtensions,
                        audioExtensions, pluginpath,
                        filmLocations, extensionsToIgnore,
                        videoExtensionsCommon, importer, section);
        }
        private static bool GetEntertainmentMediaLocations(Importer importer, string propertyName, ref string value)
        {
            string oldValue = value;

                    if (String.Compare(propertyName,
                        "AdvancedSettingsFoldersa",
                        StringComparison.OrdinalIgnoreCase) == 0)
                    {

                        MediaFolders.API.OpenSettingsWindow
                            (ref value, importer.Ibs);

                        if (String.CompareOrdinal
                            (value, "Canceled") == 0)
                            value = oldValue;

                        return true;

                    }

                    return false;
        }
        internal static void StartMainImportingEngine(Importer importer,
                     IBaseSystem iBaseSystem,
                     IMLSection section, 
                     IEnumerable<string> combinedSceneTags)
        {
            GeneralStatus = "Performing media importing...";
                    SpecialStatus = String.Empty;

                    MediaImportingEngine.ImportMediaFilesMain
                        (combinedSceneTags, importer, section);

                    MediaImportingEngineHelpers
                        .RunMediaSectionsUpdatingEngine
                        (importer, iBaseSystem, section,
                        combinedSceneTags);
        }
 protected internal static bool EditMediaFoldersSettings(Importer importer, string propertyName, ref string value)
 {
     return GetEntertainmentMediaLocations
                        (importer, propertyName, ref value);
 }
 internal static bool RunMediaSectionsUpdatingEngine(Importer importer,
      IBaseSystem iBaseSystem,
      IMLSection section,
      IEnumerable<string> combinedSceneTags)
 {
     return !MediaUpdaters
         .UpdateMediaSections
         (iBaseSystem, section,
         combinedSceneTags);
 }