修复网易云歌曲ID溢出问题

This commit is contained in:
ZaneYork 2024-05-21 17:41:40 +08:00
parent 61aa31cc6f
commit 444f4e75a6
2 changed files with 4 additions and 4 deletions

View File

@ -4,13 +4,13 @@ namespace ZonyLrcTools.Common.Lyrics.Providers.NetEase.JsonModel
{ {
public class GetSongDetailsRequest public class GetSongDetailsRequest
{ {
public GetSongDetailsRequest(int songId) public GetSongDetailsRequest(long songId)
{ {
SongId = songId; SongId = songId;
SongIds = $"%5B{songId}%5D"; SongIds = $"%5B{songId}%5D";
} }
[JsonProperty("id")] public int SongId { get; } [JsonProperty("id")] public long SongId { get; }
[JsonProperty("ids")] public string SongIds { get; } [JsonProperty("ids")] public string SongIds { get; }
} }

View File

@ -8,7 +8,7 @@ namespace ZonyLrcTools.Common.Lyrics.Providers.NetEase.JsonModel
[JsonProperty("code")] public int StatusCode { get; set; } [JsonProperty("code")] public int StatusCode { get; set; }
public int GetFirstMatchSongId(string songName, long? duration) public long GetFirstMatchSongId(string songName, long? duration)
{ {
var perfectMatch = Items.SongItems.FirstOrDefault(x => x.Name == songName); var perfectMatch = Items.SongItems.FirstOrDefault(x => x.Name == songName);
if (perfectMatch != null) if (perfectMatch != null)
@ -44,7 +44,7 @@ namespace ZonyLrcTools.Common.Lyrics.Providers.NetEase.JsonModel
/// 歌曲的 Sid (Song Id)。 /// 歌曲的 Sid (Song Id)。
/// </summary> /// </summary>
[JsonProperty("id")] [JsonProperty("id")]
public int Id { get; set; } public long Id { get; set; }
/// <summary> /// <summary>
/// 歌曲的演唱者。 /// 歌曲的演唱者。