Exemple #1
0
        private async void OnSuccessfulRecording(RecordingInfo recording)
        {
            if (GetConfiguration().EnableAutoOrganize)
            {
                if (recording.IsSeries)
                {
                    try
                    {
                        // this is to account for the library monitor holding a lock for additional time after the change is complete.
                        // ideally this shouldn't be hard-coded
                        await Task.Delay(30000).ConfigureAwait(false);

                        var organize = new EpisodeFileOrganizer(_organizationService, _config, _fileSystem, _logger, _libraryManager, _libraryMonitor, _providerManager);

                        var result = await organize.OrganizeEpisodeFile(recording.Path, CancellationToken.None).ConfigureAwait(false);

                        if (result.Status == FileSortingStatus.Success)
                        {
                            _recordingProvider.Delete(recording);
                        }
                    }
                    catch (Exception ex)
                    {
                        _logger.ErrorException("Error processing new recording", ex);
                    }
                }
            }
        }
Exemple #2
0
        private async void OnSuccessfulRecording(RecordingInfo recording)
        {
            if (GetConfiguration().EnableAutoOrganize)
            {
                if (recording.IsSeries)
                {
                    try
                    {
                        var organize = new EpisodeFileOrganizer(_organizationService, _config, _fileSystem, _logger, _libraryManager, _libraryMonitor, _providerManager);

                        var result = await organize.OrganizeEpisodeFile(recording.Path, CancellationToken.None).ConfigureAwait(false);

                        if (result.Status == FileSortingStatus.Success)
                        {
                            _recordingProvider.Delete(recording);
                        }
                    }
                    catch (Exception ex)
                    {
                        _logger.ErrorException("Error processing new recording", ex);
                    }
                }
            }
        }