private void DoScheduleImport(ImportJobInformation importJobInformation)
        {
            if (_status == Status.Shutdown)
            {
                ServiceRegistration.Get <ILogger>().Error("ImporterWorker: Scheduling of an ImportJob was requested although status was neither 'Activated' nor 'Suspended' but 'Shutdown'");
                return;
            }

            // For now we always set this to active to make it look like the old ImporterWorker
            // ToDo: Remove this and all usages of ImportJobInformation.State
            importJobInformation.State = ImportJobState.Active;

            // if the ImportJob to be scheduled is the same as or contains an
            // already running ImportJob, cancel the already running ImportJob
            // and schedule this one
            var jobsToBeCancelled = new HashSet <ImportJobController>();

            foreach (var kvp in _importJobControllers)
            {
                if (importJobInformation >= kvp.Key)
                {
                    ServiceRegistration.Get <ILogger>().Info("ImporterWorker: {0} is contained in or the same as the ImportJob which is currently being scheduled. Canceling {1}", kvp.Value, kvp.Value);
                    kvp.Value.Cancel();
                    jobsToBeCancelled.Add(kvp.Value);
                }
            }
            // We need to wait here until the canceled ImportJobs are removed from _importJobControllers
            // otherwise we run into trouble when the ImportJobs equal each other because then they
            // have the same key in _importJobControllers.
            Task.WhenAll(jobsToBeCancelled.Select(controller => controller.Completion)).Wait();
            foreach (var controller in jobsToBeCancelled)
            {
                controller.Dispose();
            }

            //Set updated media items to changed
            _mediaBrowsing?.MarkUpdatableMediaItems();

            var importJobController = new ImportJobController(new ImportJobNewGen(importJobInformation, null), Interlocked.Increment(ref _numberOfLastImportJob), this);

            _importJobControllers[importJobInformation] = importJobController;

            ServiceRegistration.Get <ILogger>().Info("ImporterWorker: Scheduled {0} ({1}) (Path ='{2}', ImportJobType='{3}', IncludeSubdirectories='{4}')", importJobController, _status, importJobInformation.BasePath, importJobInformation.JobType, importJobInformation.IncludeSubDirectories);
            ImporterWorkerMessaging.SendImportMessage(ImporterWorkerMessaging.MessageType.ImportScheduled, importJobInformation.BasePath, importJobInformation.JobType);

            if (_status == Status.Activated)
            {
                importJobController.Activate(_mediaBrowsing, _importResultHandler);
            }
        }