Only run InheritFolderPermissions on Windows

pull/3113/head
Mark McDowall 11 years ago
parent acd2069d5a
commit c708b5ce1a

@ -3,6 +3,7 @@ using System.IO;
using System.Linq; using System.Linq;
using NLog; using NLog;
using NzbDrone.Common; using NzbDrone.Common;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Organizer; using NzbDrone.Core.Organizer;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
@ -84,15 +85,19 @@ namespace NzbDrone.Core.MediaFiles
_diskProvider.SetFolderWriteTime(seasonFolder, episodeFile.DateAdded); _diskProvider.SetFolderWriteTime(seasonFolder, episodeFile.DateAdded);
} }
//Wrapped in Try/Catch to prevent this from causing issues with remote NAS boxes, the move worked, which is more important. //We should only run this on Windows
try if (OsInfo.IsWindows)
{ {
_diskProvider.InheritFolderPermissions(destinationFilename); //Wrapped in Try/Catch to prevent this from causing issues with remote NAS boxes, the move worked, which is more important.
} try
catch (UnauthorizedAccessException ex) {
{ _diskProvider.InheritFolderPermissions(destinationFilename);
_logger.Debug("Unable to apply folder permissions to: ", destinationFilename); }
_logger.TraceException(ex.Message, ex); catch (UnauthorizedAccessException ex)
{
_logger.Debug("Unable to apply folder permissions to: ", destinationFilename);
_logger.TraceException(ex.Message, ex);
}
} }
} }
} }

Loading…
Cancel
Save