1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Fixed: Set permissions on extra and subtitle files

This commit is contained in:
Mark McDowall 2019-10-07 09:40:48 -07:00 committed by Qstick
parent 42b4a03eb4
commit d6cac3add8
2 changed files with 8 additions and 0 deletions

View File

@ -13,15 +13,18 @@ namespace NzbDrone.Core.Extras.Others
public class OtherExtraService : ExtraFileManager<OtherExtraFile>
{
private readonly IOtherExtraFileService _otherExtraFileService;
private readonly IMediaFileAttributeService _mediaFileAttributeService;
public OtherExtraService(IConfigService configService,
IDiskProvider diskProvider,
IDiskTransferService diskTransferService,
IOtherExtraFileService otherExtraFileService,
IMediaFileAttributeService mediaFileAttributeService,
Logger logger)
: base(configService, diskProvider, diskTransferService, logger)
{
_otherExtraFileService = otherExtraFileService;
_mediaFileAttributeService = mediaFileAttributeService;
}
public override int Order => 2;
@ -65,6 +68,7 @@ public override ExtraFile Import(Movie movie, MovieFile movieFile, string path,
{
var extraFile = ImportFile(movie, movieFile, path, readOnly, extension, null);
_mediaFileAttributeService.SetFilePermissions(path);
_otherExtraFileService.Upsert(extraFile);
return extraFile;

View File

@ -17,16 +17,19 @@ namespace NzbDrone.Core.Extras.Subtitles
public class SubtitleService : ExtraFileManager<SubtitleFile>
{
private readonly ISubtitleFileService _subtitleFileService;
private readonly IMediaFileAttributeService _mediaFileAttributeService;
private readonly Logger _logger;
public SubtitleService(IConfigService configService,
IDiskProvider diskProvider,
IDiskTransferService diskTransferService,
ISubtitleFileService subtitleFileService,
IMediaFileAttributeService mediaFileAttributeService,
Logger logger)
: base(configService, diskProvider, diskTransferService, logger)
{
_subtitleFileService = subtitleFileService;
_mediaFileAttributeService = mediaFileAttributeService;
_logger = logger;
}
@ -92,6 +95,7 @@ public override ExtraFile Import(Movie movie, MovieFile movieFile, string path,
var subtitleFile = ImportFile(movie, movieFile, path, readOnly, extension, suffix);
subtitleFile.Language = language;
_mediaFileAttributeService.SetFilePermissions(path);
_subtitleFileService.Upsert(subtitleFile);
return subtitleFile;