Fixed: Set permissions on extra and subtitle files

pull/3396/head
Mark McDowall 5 years ago
parent f0c90a4744
commit 5a3bd8cfe5

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

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

Loading…
Cancel
Save