mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2025-09-06 21:56:53 +00:00
refactor: reformat source code.
This commit is contained in:
@@ -4,17 +4,13 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.KuGou.JsonModel
|
||||
{
|
||||
public class GetLyricAccessKeyRequest
|
||||
{
|
||||
[JsonProperty("ver")]
|
||||
public int UnknownParameters1 { get; }
|
||||
[JsonProperty("ver")] public int UnknownParameters1 { get; }
|
||||
|
||||
[JsonProperty("man")]
|
||||
public string UnknownParameters2 { get; }
|
||||
|
||||
[JsonProperty("client")]
|
||||
public string UnknownParameters3 { get; }
|
||||
[JsonProperty("man")] public string UnknownParameters2 { get; }
|
||||
|
||||
[JsonProperty("hash")]
|
||||
public string FileHash { get; }
|
||||
[JsonProperty("client")] public string UnknownParameters3 { get; }
|
||||
|
||||
[JsonProperty("hash")] public string FileHash { get; }
|
||||
|
||||
public GetLyricAccessKeyRequest(string fileHash)
|
||||
{
|
||||
|
@@ -5,22 +5,17 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.KuGou.JsonModel
|
||||
{
|
||||
public class GetLyricAccessKeyResponse
|
||||
{
|
||||
[JsonProperty("status")]
|
||||
public int Status { get; set; }
|
||||
[JsonProperty("status")] public int Status { get; set; }
|
||||
|
||||
[JsonProperty("errcode")]
|
||||
public int ErrorCode { get; set; }
|
||||
[JsonProperty("errcode")] public int ErrorCode { get; set; }
|
||||
|
||||
[JsonProperty("candidates")]
|
||||
public List<GetLyricAccessKeyDataObject> AccessKeyDataObjects { get; set; }
|
||||
[JsonProperty("candidates")] public List<GetLyricAccessKeyDataObject> AccessKeyDataObjects { get; set; }
|
||||
}
|
||||
|
||||
public class GetLyricAccessKeyDataObject
|
||||
{
|
||||
[JsonProperty("accesskey")]
|
||||
public string AccessKey { get; set; }
|
||||
[JsonProperty("accesskey")] public string AccessKey { get; set; }
|
||||
|
||||
[JsonProperty("id")]
|
||||
public string Id { get; set; }
|
||||
[JsonProperty("id")] public string Id { get; set; }
|
||||
}
|
||||
}
|
@@ -6,14 +6,11 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.KuGou.JsonModel
|
||||
{
|
||||
public class SongSearchRequest
|
||||
{
|
||||
[JsonProperty("filter")]
|
||||
public int Filter { get; }
|
||||
[JsonProperty("filter")] public int Filter { get; }
|
||||
|
||||
[JsonProperty("platform")]
|
||||
public string Platform { get; }
|
||||
[JsonProperty("platform")] public string Platform { get; }
|
||||
|
||||
[JsonProperty("keyword")]
|
||||
public string Keyword { get; }
|
||||
[JsonProperty("keyword")] public string Keyword { get; }
|
||||
|
||||
public SongSearchRequest(string musicName, string artistName)
|
||||
{
|
||||
|
@@ -5,23 +5,18 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.KuGou.JsonModel
|
||||
{
|
||||
public class SongSearchResponse
|
||||
{
|
||||
[JsonProperty("status")]
|
||||
public int Status { get; set; }
|
||||
[JsonProperty("status")] public int Status { get; set; }
|
||||
|
||||
[JsonProperty("data")]
|
||||
public SongSearchResponseInnerData Data { get; set; }
|
||||
[JsonProperty("data")] public SongSearchResponseInnerData Data { get; set; }
|
||||
|
||||
[JsonProperty("error_code")]
|
||||
public int ErrorCode { get; set; }
|
||||
[JsonProperty("error_code")] public int ErrorCode { get; set; }
|
||||
|
||||
[JsonProperty("error_msg")]
|
||||
public string ErrorMessage { get; set; }
|
||||
[JsonProperty("error_msg")] public string ErrorMessage { get; set; }
|
||||
}
|
||||
|
||||
public class SongSearchResponseInnerData
|
||||
{
|
||||
[JsonProperty("lists")]
|
||||
public List<SongSearchResponseSongDetail> List { get; set; }
|
||||
[JsonProperty("lists")] public List<SongSearchResponseSongDetail> List { get; set; }
|
||||
}
|
||||
|
||||
public class SongSearchResponseSongDetail
|
||||
|
@@ -90,7 +90,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric
|
||||
|
||||
public static bool operator ==(LyricItem left, LyricItem right)
|
||||
{
|
||||
return (int?) left?.SortScore == (int?) right?.SortScore;
|
||||
return (int?)left?.SortScore == (int?)right?.SortScore;
|
||||
}
|
||||
|
||||
public static bool operator !=(LyricItem item1, LyricItem item2)
|
||||
@@ -113,7 +113,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((LyricItem) obj);
|
||||
return Equals((LyricItem)obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
|
@@ -97,7 +97,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric
|
||||
private static Dictionary<int, bool> BuildMarkDictionary(LyricItemCollection items)
|
||||
{
|
||||
return items
|
||||
.Select((item, index) => new {index, item})
|
||||
.Select((item, index) => new { index, item })
|
||||
.ToDictionary(item => item.index, item => false);
|
||||
}
|
||||
|
||||
|
@@ -70,7 +70,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.QQMusic
|
||||
|
||||
protected virtual void ValidateSongSearchResponse(SongSearchResponse response, LyricDownloaderArgs args)
|
||||
{
|
||||
if (response is not {StatusCode: 0} || response.Data.Song.SongItems == null)
|
||||
if (response is not { StatusCode: 0 } || response.Data.Song.SongItems == null)
|
||||
{
|
||||
throw new ErrorCodeException(ErrorCodes.TheReturnValueIsIllegal, attachObj: args);
|
||||
}
|
||||
|
Reference in New Issue
Block a user