diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-08-21 15:39:41 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-21 15:39:41 -0400 |
| commit | 3f6b5feffba3aacbbf0387edffad0428f93ad675 (patch) | |
| tree | f3eaac4c45a827b111ed4813a8c22ad0e57f6885 /MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs | |
| parent | 30ba965ed2096139d9064b031e338bf81835aba8 (diff) | |
| parent | 9f7dbec0db461fe416d825b483d475f476c9d42d (diff) | |
Merge pull request #2087 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs b/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs index 39992b65d..5e01666a9 100644 --- a/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs +++ b/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs @@ -272,6 +272,18 @@ namespace MediaBrowser.Server.Implementations.FileOrganization var originalExtractedSeriesString = result.ExtractedName; + bool isNew = string.IsNullOrWhiteSpace(result.Id); + + if (isNew) + { + await _organizationService.SaveResult(result, cancellationToken); + } + + if (!_organizationService.AddToInProgressList(result, isNew)) + { + throw new Exception("File is currently processed otherwise. Please try again later."); + } + try { // Proceed to sort the file @@ -363,6 +375,10 @@ namespace MediaBrowser.Server.Implementations.FileOrganization _logger.Warn(ex.Message); return; } + finally + { + _organizationService.RemoveFromInprogressList(result); + } if (rememberCorrection) { |
