Fixed: Set permissions on new series folders (mono)

This commit is contained in:
Mark McDowall 2014-08-10 21:20:06 -07:00
parent 78e5209cfd
commit 9ffdf18935
1 changed files with 24 additions and 1 deletions

View File

@ -1,4 +1,5 @@
using System.Diagnostics;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using NLog;
@ -74,6 +75,7 @@ namespace NzbDrone.Core.MediaFiles
{
_logger.Debug("Creating missing series folder: {0}", series.Path);
_diskProvider.CreateFolder(series.Path);
SetPermissions(series.Path);
}
else
{
@ -112,6 +114,27 @@ namespace NzbDrone.Core.MediaFiles
return mediaFileList.ToArray();
}
private void SetPermissions(String path)
{
if (!_configService.SetPermissionsLinux)
{
return;
}
try
{
var permissions = _configService.FolderChmod;
_diskProvider.SetPermissions(path, permissions, _configService.ChownUser, _configService.ChownGroup);
}
catch (Exception ex)
{
_logger.WarnException("Unable to apply permissions to: " + path, ex);
_logger.DebugException(ex.Message, ex);
}
}
public void Handle(SeriesUpdatedEvent message)
{
Scan(message.Series);