From a591227052ca3c74ec5cb1fb38763540b5df89e1 Mon Sep 17 00:00:00 2001 From: Qstick Date: Thu, 12 Nov 2020 22:55:16 -0500 Subject: [PATCH] Fixed: Nested Folder in MovieFolder Naming not created automatically --- src/NzbDrone.Core/MediaFiles/MovieFileMovingService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/MediaFiles/MovieFileMovingService.cs b/src/NzbDrone.Core/MediaFiles/MovieFileMovingService.cs index a1af38c9e..bf469db4a 100644 --- a/src/NzbDrone.Core/MediaFiles/MovieFileMovingService.cs +++ b/src/NzbDrone.Core/MediaFiles/MovieFileMovingService.cs @@ -11,6 +11,7 @@ using NzbDrone.Core.Movies; using NzbDrone.Core.Organizer; using NzbDrone.Core.Parser.Model; +using NzbDrone.Core.RootFolders; namespace NzbDrone.Core.MediaFiles { @@ -30,6 +31,7 @@ public class MovieFileMovingService : IMoveMovieFiles private readonly IMediaFileAttributeService _mediaFileAttributeService; private readonly IEventAggregator _eventAggregator; private readonly IConfigService _configService; + private readonly IRootFolderService _rootFolderService; private readonly Logger _logger; public MovieFileMovingService(IUpdateMovieFileService updateMovieFileService, @@ -39,6 +41,7 @@ public MovieFileMovingService(IUpdateMovieFileService updateMovieFileService, IMediaFileAttributeService mediaFileAttributeService, IEventAggregator eventAggregator, IConfigService configService, + IRootFolderService rootFolderService, Logger logger) { _updateMovieFileService = updateMovieFileService; @@ -48,6 +51,7 @@ public MovieFileMovingService(IUpdateMovieFileService updateMovieFileService, _mediaFileAttributeService = mediaFileAttributeService; _eventAggregator = eventAggregator; _configService = configService; + _rootFolderService = rootFolderService; _logger = logger; } @@ -140,7 +144,7 @@ private void EnsureMovieFolder(MovieFile movieFile, Movie movie, string filePath var movieFileFolder = Path.GetDirectoryName(filePath); var movieFolder = movie.Path; - var rootFolder = new OsPath(movieFolder).Directory.FullPath; + var rootFolder = _rootFolderService.GetBestRootFolderPath(movieFolder); if (!_diskProvider.FolderExists(rootFolder)) {