Exemplo n.º 1
0
        public async Task ProcessPlexServerContent(IEnumerable <int> contentIds)
        {
            _log.LogInformation("Starting the Metadata refresh from RecentlyAddedSync");
            var plexSettings = await _plexSettings.GetSettingsAsync();

            var embySettings = await _embySettings.GetSettingsAsync();

            try
            {
                if (plexSettings.Enable)
                {
                    await StartPlexWithKnownContent(contentIds);
                }
            }
            catch (Exception e)
            {
                _log.LogError(e, "Exception when refreshing the Plex Metadata");
                throw;
            }
            finally
            {
                if (plexSettings.Enable)
                {
                    BackgroundJob.Enqueue(() => _plexAvailabilityChecker.Start());
                }

                if (embySettings.Enable)
                {
                    BackgroundJob.Enqueue(() => _embyAvaliabilityChecker.Start());
                }
            }
        }
Exemplo n.º 2
0
        public async Task Start()
        {
            var settings = await _settings.GetSettingsAsync();

            foreach (var server in settings.Servers)
            {
                await CacheEpisodes(server);
            }

            BackgroundJob.Enqueue(() => _avaliabilityChecker.Start());
        }