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
commit 8c657ddb24
2 changed files with 8 additions and 0 deletions

View file

@ -15,16 +15,19 @@ namespace NzbDrone.Core.Extras.Lyrics
public class LyricService : ExtraFileManager<LyricFile>
{
private readonly ILyricFileService _lyricFileService;
private readonly IMediaFileAttributeService _mediaFileAttributeService;
private readonly Logger _logger;
public LyricService(IConfigService configService,
IDiskProvider diskProvider,
IDiskTransferService diskTransferService,
ILyricFileService lyricFileService,
IMediaFileAttributeService mediaFileAttributeService,
Logger logger)
: base(configService, diskProvider, diskTransferService, logger)
{
_lyricFileService = lyricFileService;
_mediaFileAttributeService = mediaFileAttributeService;
_logger = logger;
}
@ -88,6 +91,7 @@ namespace NzbDrone.Core.Extras.Lyrics
var suffix = GetSuffix(1, false);
var subtitleFile = ImportFile(artist, trackFile, path, readOnly, extension, suffix);
_mediaFileAttributeService.SetFilePermissions(path);
_lyricFileService.Upsert(subtitleFile);
return subtitleFile;

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 @@ namespace NzbDrone.Core.Extras.Others
{
var extraFile = ImportFile(artist, trackFile, path, readOnly, extension, null);
_mediaFileAttributeService.SetFilePermissions(path);
_otherExtraFileService.Upsert(extraFile);
return extraFile;