chore: Fix compilation warning messages.

This commit is contained in:
real-zony
2023-05-24 22:57:55 +08:00
parent 1e5c41852f
commit 383e2c5939
46 changed files with 145 additions and 152 deletions

View File

@@ -6,7 +6,7 @@ public class GetLyricsResponse
{
[JsonProperty("status")] public int Status { get; set; }
[JsonProperty("data")] public GetLyricsResponseInnerData Data { get; set; }
[JsonProperty("data")] public GetLyricsResponseInnerData? Data { get; set; }
[JsonProperty("msg")] public string? ErrorMessage { get; set; }
@@ -20,7 +20,7 @@ public class GetLyricsResponseInnerData
public class GetLyricsItem
{
[JsonProperty("lineLyric")] public string Text { get; set; }
[JsonProperty("lineLyric")] public string? Text { get; set; }
[JsonProperty("time")] public string Position { get; set; }
[JsonProperty("time")] public string Position { get; set; } = null!;
}

View File

@@ -6,7 +6,7 @@ public class SongSearchResponse
{
[JsonProperty("code")] public int Code { get; set; }
[JsonProperty("data")] public SongSearchResponseInnerData InnerData { get; set; }
[JsonProperty("data")] public SongSearchResponseInnerData InnerData { get; set; } = null!;
[JsonProperty("msg")] public string? ErrorMessage { get; set; }
@@ -29,9 +29,9 @@ public class SongSearchResponse
public class SongSearchResponseInnerData
{
[JsonProperty("total")] public string Total { get; set; }
[JsonProperty("total")] public string? Total { get; set; }
[JsonProperty("list")] public ICollection<SongSearchResponseDetail> SongItems { get; set; }
[JsonProperty("list")] public ICollection<SongSearchResponseDetail> SongItems { get; set; } = null!;
}
public class SongSearchResponseDetail

View File

@@ -60,7 +60,7 @@ public class KuWoLyricsProvider : LyricsProvider
await ValueTask.CompletedTask;
var lyricsResponse = (GetLyricsResponse)lyricsObject;
if (lyricsResponse.Data.Lyrics == null)
if (lyricsResponse.Data?.Lyrics == null)
{
return new LyricsItemCollection(null);
}