mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Fixed: Set permissions on new series folders (mono)
This commit is contained in:
parent
78e5209cfd
commit
9ffdf18935
@ -1,4 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
@ -74,6 +75,7 @@ public void Scan(Series series)
|
||||
{
|
||||
_logger.Debug("Creating missing series folder: {0}", series.Path);
|
||||
_diskProvider.CreateFolder(series.Path);
|
||||
SetPermissions(series.Path);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -112,6 +114,27 @@ public string[] GetVideoFiles(string path, bool allDirectories = true)
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user