aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs')
-rw-r--r--MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs b/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs
index a2e094e9a..d4d7f2f21 100644
--- a/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs
+++ b/MediaBrowser.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs
@@ -50,7 +50,8 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
Date = DateTime.UtcNow,
OriginalPath = path,
OriginalFileName = Path.GetFileName(path),
- Type = FileOrganizerType.Episode
+ Type = FileOrganizerType.Episode,
+ FileSize = new FileInfo(path).Length
};
var seriesName = TVUtils.GetSeriesNameFromEpisodeFile(path);
@@ -102,6 +103,17 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
_logger.Warn(msg);
}
+ var previousResult = _organizationService.GetResultBySourcePath(path);
+
+ if (previousResult != null)
+ {
+ // Don't keep saving the same result over and over if nothing has changed
+ if (previousResult.Status == result.Status && result.Status != FileSortingStatus.Success)
+ {
+ return previousResult;
+ }
+ }
+
await _organizationService.SaveResult(result, CancellationToken.None).ConfigureAwait(false);
return result;