From 5a3bd8cfe5a9bc020c83a798a48883e426e6545e Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 7 Oct 2019 09:40:48 -0700 Subject: [PATCH] Fixed: Set permissions on extra and subtitle files --- src/NzbDrone.Core/Extras/Others/OtherExtraService.cs | 4 ++++ src/NzbDrone.Core/Extras/Subtitles/SubtitleService.cs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/NzbDrone.Core/Extras/Others/OtherExtraService.cs b/src/NzbDrone.Core/Extras/Others/OtherExtraService.cs index 62d9f5129..5323a2488 100644 --- a/src/NzbDrone.Core/Extras/Others/OtherExtraService.cs +++ b/src/NzbDrone.Core/Extras/Others/OtherExtraService.cs @@ -15,15 +15,18 @@ namespace NzbDrone.Core.Extras.Others public class OtherExtraService : ExtraFileManager { 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; @@ -67,6 +70,7 @@ namespace NzbDrone.Core.Extras.Others { var extraFile = ImportFile(series, episodeFile, path, readOnly, extension, null); + _mediaFileAttributeService.SetFilePermissions(path); _otherExtraFileService.Upsert(extraFile); return extraFile; diff --git a/src/NzbDrone.Core/Extras/Subtitles/SubtitleService.cs b/src/NzbDrone.Core/Extras/Subtitles/SubtitleService.cs index 1ffa8db24..d8d72612f 100644 --- a/src/NzbDrone.Core/Extras/Subtitles/SubtitleService.cs +++ b/src/NzbDrone.Core/Extras/Subtitles/SubtitleService.cs @@ -17,16 +17,19 @@ namespace NzbDrone.Core.Extras.Subtitles public class SubtitleService : ExtraFileManager { 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,8 +95,10 @@ namespace NzbDrone.Core.Extras.Subtitles var subtitleFile = ImportFile(series, episodeFile, path, readOnly, extension, suffix); subtitleFile.Language = language; + _mediaFileAttributeService.SetFilePermissions(path); _subtitleFileService.Upsert(subtitleFile); + return subtitleFile; }