chore: Move the related configuration items to the Common library.

This commit is contained in:
real-zony
2022-10-06 12:29:56 +08:00
parent 9f96aa0186
commit aa90e232f7
15 changed files with 35 additions and 40 deletions

View File

@@ -3,10 +3,10 @@ using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using Newtonsoft.Json.Linq;
using ZonyLrcTools.Cli.Config;
using ZonyLrcTools.Cli.Infrastructure.Exceptions;
using ZonyLrcTools.Cli.Infrastructure.Lyric.KuGou.JsonModel;
using ZonyLrcTools.Cli.Infrastructure.Network;
using ZonyLrcTools.Common.Configuration;
namespace ZonyLrcTools.Cli.Infrastructure.Lyric.KuGou
{
@@ -16,7 +16,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.KuGou
private readonly IWarpHttpClient _warpHttpClient;
private readonly ILyricItemCollectionFactory _lyricItemCollectionFactory;
private readonly ToolOptions _options;
private readonly GlobalOptions _options;
private const string KuGouSearchMusicUrl = @"https://songsearch.kugou.com/song_search_v2";
private const string KuGouGetLyricAccessKeyUrl = @"http://lyrics.kugou.com/search";
@@ -24,7 +24,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.KuGou
public KuGourLyricDownloader(IWarpHttpClient warpHttpClient,
ILyricItemCollectionFactory lyricItemCollectionFactory,
IOptions<ToolOptions> options)
IOptions<GlobalOptions> options)
{
_warpHttpClient = warpHttpClient;
_lyricItemCollectionFactory = lyricItemCollectionFactory;

View File

@@ -2,7 +2,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZonyLrcTools.Cli.Config;
using ZonyLrcTools.Cli.Infrastructure.Extensions;
using ZonyLrcTools.Common.Configuration;

View File

@@ -1,7 +1,7 @@
using System.Text.RegularExpressions;
using Microsoft.Extensions.Options;
using ZonyLrcTools.Cli.Config;
using ZonyLrcTools.Cli.Infrastructure.DependencyInject;
using ZonyLrcTools.Common.Configuration;
namespace ZonyLrcTools.Cli.Infrastructure.Lyric
{
@@ -10,9 +10,9 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric
/// </summary>
public class LyricItemCollectionFactory : ILyricItemCollectionFactory, ITransientDependency
{
private readonly ToolOptions _options;
private readonly GlobalOptions _options;
public LyricItemCollectionFactory(IOptions<ToolOptions> options)
public LyricItemCollectionFactory(IOptions<GlobalOptions> options)
{
_options = options.Value;
}

View File

@@ -4,10 +4,10 @@ using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using ZonyLrcTools.Cli.Config;
using ZonyLrcTools.Cli.Infrastructure.Exceptions;
using ZonyLrcTools.Cli.Infrastructure.Lyric.NetEase.JsonModel;
using ZonyLrcTools.Cli.Infrastructure.Network;
using ZonyLrcTools.Common.Configuration;
namespace ZonyLrcTools.Cli.Infrastructure.Lyric.NetEase
{
@@ -17,7 +17,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.NetEase
private readonly IWarpHttpClient _warpHttpClient;
private readonly ILyricItemCollectionFactory _lyricItemCollectionFactory;
private readonly ToolOptions _options;
private readonly GlobalOptions _options;
private const string NetEaseSearchMusicUrl = @"https://music.163.com/api/search/get/web";
private const string NetEaseGetLyricUrl = @"https://music.163.com/api/song/lyric";
@@ -27,7 +27,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.NetEase
public NetEaseLyricDownloader(IWarpHttpClient warpHttpClient,
ILyricItemCollectionFactory lyricItemCollectionFactory,
IOptions<ToolOptions> options)
IOptions<GlobalOptions> options)
{
_warpHttpClient = warpHttpClient;
_lyricItemCollectionFactory = lyricItemCollectionFactory;