aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-08-25 14:46:19 -0400
committerGitHub <noreply@github.com>2016-08-25 14:46:19 -0400
commitba9577f3801105c2f85c061fa7c4c3ee445032ad (patch)
treed06d1da4e2284fcf36c36f7ac1ec84c9613ad812 /MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs
parent870c843194a8684d1f1098bbed79ecb27cd3478b (diff)
parent1ffd9b31577773d3c87c2b6621c8803b2b17e85c (diff)
Merge pull request #2101 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs')
-rw-r--r--MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs16
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)
{