aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-08-20 14:38:27 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-08-20 14:38:27 -0400
commit234dcaf458b935a7941d5d8dc70496dd4df83ffc (patch)
treeb56fda623ff38e41211fa0553cf69e9fdde1a51b /MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs
parenta813083c9716e42913dabaf1fa88c0bac4caa27f (diff)
parent10906bcb8a9e5ac9ecca0ddf86c53da631326a2a (diff)
Merge branch 'dev' of https://github.com/MediaBrowser/Emby into dev
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)
{