mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2025-09-06 21:56:53 +00:00
refactor: Move the related configuration items to the Common library.
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
namespace ZonyLrcTools.Cli.Infrastructure.Lyric
|
||||
{
|
||||
/// <summary>
|
||||
/// 换行符格式定义。
|
||||
/// </summary>
|
||||
public static class LineBreakType
|
||||
{
|
||||
/// <summary>
|
||||
/// Windows 系统。
|
||||
/// </summary>
|
||||
public const string Windows = "\r\n";
|
||||
|
||||
/// <summary>
|
||||
/// macOS 系统。
|
||||
/// </summary>
|
||||
public const string MacOs = "\r";
|
||||
|
||||
/// <summary>
|
||||
/// UNIX 系统(Linux)。
|
||||
/// </summary>
|
||||
public const string Unix = "\n";
|
||||
}
|
||||
}
|
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using ZonyLrcTools.Cli.Config;
|
||||
using ZonyLrcTools.Cli.Infrastructure.Extensions;
|
||||
using ZonyLrcTools.Common.Configuration;
|
||||
|
||||
namespace ZonyLrcTools.Cli.Infrastructure.Lyric
|
||||
{
|
||||
@@ -17,11 +18,11 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric
|
||||
/// </summary>
|
||||
public bool IsPruneMusic => Count == 0;
|
||||
|
||||
public LyricConfigOption Option { get; private set; }
|
||||
public GlobalLyricsConfigOptions Options { get; private set; }
|
||||
|
||||
public LyricItemCollection(LyricConfigOption option)
|
||||
public LyricItemCollection(GlobalLyricsConfigOptions options)
|
||||
{
|
||||
Option = option;
|
||||
Options = options;
|
||||
}
|
||||
|
||||
public static LyricItemCollection operator +(LyricItemCollection left, LyricItemCollection right)
|
||||
@@ -31,7 +32,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric
|
||||
return left;
|
||||
}
|
||||
|
||||
var option = left.Option;
|
||||
var option = left.Options;
|
||||
var newCollection = new LyricItemCollection(option);
|
||||
var indexDiff = left.Count - right.Count;
|
||||
if (!option.IsOneLine)
|
||||
@@ -104,8 +105,8 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric
|
||||
public override string ToString()
|
||||
{
|
||||
var lyricBuilder = new StringBuilder();
|
||||
ForEach(lyric => lyricBuilder.Append(lyric).Append(Option.LineBreak));
|
||||
return lyricBuilder.ToString().TrimEnd(Option.LineBreak);
|
||||
ForEach(lyric => lyricBuilder.Append(lyric).Append(Options.LineBreak));
|
||||
return lyricBuilder.ToString().TrimEnd(Options.LineBreak);
|
||||
}
|
||||
|
||||
public byte[] GetUtf8Bytes()
|
||||
|
Reference in New Issue
Block a user