From 172453b83f4e12b75321b45b2e36700bba0c33c4 Mon Sep 17 00:00:00 2001 From: real-zony Date: Tue, 11 May 2021 00:31:14 +0800 Subject: [PATCH] feat: Add lyrics downloader related configuration items. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加歌词下载器相关的配置项。 --- src/ZonyLrcTools.Cli/Config/ToolOptions.cs | 7 +++++++ .../Infrastructure/Lyric/LyricDownloaderOption.cs | 15 +++++++++++++++ src/ZonyLrcTools.Cli/appsettings.json | 12 +++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/ZonyLrcTools.Cli/Infrastructure/Lyric/LyricDownloaderOption.cs diff --git a/src/ZonyLrcTools.Cli/Config/ToolOptions.cs b/src/ZonyLrcTools.Cli/Config/ToolOptions.cs index df605b6..1ad955c 100644 --- a/src/ZonyLrcTools.Cli/Config/ToolOptions.cs +++ b/src/ZonyLrcTools.Cli/Config/ToolOptions.cs @@ -1,3 +1,5 @@ +using System.Collections; +using System.Collections.Generic; using ZonyLrcTools.Cli.Infrastructure.Lyric; using ZonyLrcTools.Cli.Infrastructure.Network; using ZonyLrcTools.Cli.Infrastructure.Tag; @@ -25,5 +27,10 @@ namespace ZonyLrcTools.Cli.Config /// 网络代理相关的配置信息。 /// public NetworkOptions NetworkOptions { get; set; } + + /// + /// 歌词下载器相关的配置属性。 + /// + public IEnumerable LyricDownloaderOptions { get; set; } } } \ No newline at end of file diff --git a/src/ZonyLrcTools.Cli/Infrastructure/Lyric/LyricDownloaderOption.cs b/src/ZonyLrcTools.Cli/Infrastructure/Lyric/LyricDownloaderOption.cs new file mode 100644 index 0000000..0dd72de --- /dev/null +++ b/src/ZonyLrcTools.Cli/Infrastructure/Lyric/LyricDownloaderOption.cs @@ -0,0 +1,15 @@ +namespace ZonyLrcTools.Cli.Infrastructure.Lyric +{ + public class LyricDownloaderOption + { + /// + /// 歌词下载器的唯一标识。 + /// + public string Name { get; set; } + + /// + /// 歌词下载时的优先级,当值为 -1 时是禁用。 + /// + public int Priority { get; set; } + } +} \ No newline at end of file diff --git a/src/ZonyLrcTools.Cli/appsettings.json b/src/ZonyLrcTools.Cli/appsettings.json index 890c7a6..b719498 100644 --- a/src/ZonyLrcTools.Cli/appsettings.json +++ b/src/ZonyLrcTools.Cli/appsettings.json @@ -15,6 +15,16 @@ }, "TagInfoProviderOptions": { "FileNameRegularExpressions": "(?'artist'.+)\\s-\\s(?'name'.+)" - } + }, + "LyricDownloader": [ + { + "Name": "NetEase", + "Priority": 1 + }, + { + "Name": "QQMusic", + "Priority": 2 + } + ] } } \ No newline at end of file