private void UpdateMappings()
        {
            _logger.Info("Updating Scene mapping");

            try
            {
                var mappings = _sceneMappingProxy.Fetch();

                if (mappings.Any())
                {
                    _repository.Purge();

                    foreach (var sceneMapping in mappings)
                    {
                        sceneMapping.ParseTerm = sceneMapping.ParseTerm.CleanSeriesTitle();
                    }

                    _repository.InsertMany(mappings);
                }
                else
                {
                    _logger.Warn("Received empty list of mapping. will not update.");
                }
            }
            catch (Exception ex)
            {
                _logger.ErrorException("Failed to Update Scene Mappings:", ex);
            }

            RefreshCache();
        }
Beispiel #2
0
 public List <SceneMapping> GetSceneMappings()
 {
     return(_sceneMappingProxy.Fetch());
 }