|
|
|
@ -16,14 +16,13 @@ using NzbDrone.Core.MediaFiles.TrackImport;
|
|
|
|
|
using NzbDrone.Core.Messaging.Commands;
|
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
|
using NzbDrone.Core.Music;
|
|
|
|
|
using NzbDrone.Core.Parser.Model;
|
|
|
|
|
using NzbDrone.Core.RootFolders;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.MediaFiles
|
|
|
|
|
{
|
|
|
|
|
public interface IDiskScanService
|
|
|
|
|
{
|
|
|
|
|
void Scan(List<string> folders = null, FilterFilesType filter = FilterFilesType.Known, List<int> artistIds = null);
|
|
|
|
|
void Scan(List<string> folders = null, FilterFilesType filter = FilterFilesType.Known, bool addNewArtists = false, List<int> artistIds = null);
|
|
|
|
|
IFileInfo[] GetAudioFiles(string path, bool allDirectories = true);
|
|
|
|
|
string[] GetNonAudioFiles(string path, bool allDirectories = true);
|
|
|
|
|
List<IFileInfo> FilterFiles(string basePath, IEnumerable<IFileInfo> files);
|
|
|
|
@ -68,7 +67,7 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Scan(List<string> folders = null, FilterFilesType filter = FilterFilesType.Known, List<int> artistIds = null)
|
|
|
|
|
public void Scan(List<string> folders = null, FilterFilesType filter = FilterFilesType.Known, bool addNewArtists = false, List<int> artistIds = null)
|
|
|
|
|
{
|
|
|
|
|
if (folders == null)
|
|
|
|
|
{
|
|
|
|
@ -145,7 +144,7 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
|
{
|
|
|
|
|
Filter = filter,
|
|
|
|
|
IncludeExisting = true,
|
|
|
|
|
AddNewArtists = true
|
|
|
|
|
AddNewArtists = addNewArtists
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var decisions = _importDecisionMaker.GetImportDecisions(mediaFileList, null, null, config);
|
|
|
|
@ -275,7 +274,7 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
|
|
|
|
|
|
public void Execute(RescanFoldersCommand message)
|
|
|
|
|
{
|
|
|
|
|
Scan(message.Folders, message.Filter, message.ArtistIds);
|
|
|
|
|
Scan(message.Folders, message.Filter, message.AddNewArtists, message.ArtistIds);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|