From 232c36de3bf729e7e650fae9859090e448d998c2 Mon Sep 17 00:00:00 2001 From: real-zony Date: Sun, 30 May 2021 21:49:37 +0800 Subject: [PATCH] Deleted scan command. --- src/ZonyLrcTools.Cli/Commands/ScanCommand.cs | 41 -------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/ZonyLrcTools.Cli/Commands/ScanCommand.cs diff --git a/src/ZonyLrcTools.Cli/Commands/ScanCommand.cs b/src/ZonyLrcTools.Cli/Commands/ScanCommand.cs deleted file mode 100644 index f80dee9..0000000 --- a/src/ZonyLrcTools.Cli/Commands/ScanCommand.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Linq; -using System.Threading.Tasks; -using McMaster.Extensions.CommandLineUtils; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using ZonyLrcTools.Cli.Config; -using ZonyLrcTools.Cli.Infrastructure.IO; - -namespace ZonyLrcTools.Cli.Commands -{ - [Command("scan", Description = "扫描指定目录下符合条件的音乐文件数量。")] - public class ScanCommand : ToolCommandBase - { - private readonly IFileScanner _fileScanner; - private readonly ToolOptions _options; - private readonly ILogger _logger; - - public ScanCommand(IFileScanner fileScanner, - IOptions options, - ILogger logger) - { - _fileScanner = fileScanner; - _logger = logger; - _options = options.Value; - } - - [Option("-d|--dir", CommandOptionType.SingleValue, Description = "指定需要扫描的目录。")] - [DirectoryExists] - public string DirectoryPath { get; set; } - - protected override async Task OnExecuteAsync(CommandLineApplication app) - { - var result = await _fileScanner.ScanAsync( - DirectoryPath, - _options.SupportFileExtensions.Split(';')); - - _logger.LogInformation($"目录扫描完成,共扫描到 {result.Sum(f => f.FilePaths.Count)} 个音乐文件。"); - return 0; - } - } -} \ No newline at end of file