Skip to content

Commit

Permalink
misc: 在用户定义中使用long来处理网易歌曲ID
Browse files Browse the repository at this point in the history
  • Loading branch information
MATRIX-feather committed Sep 21, 2024
1 parent 341cfe4 commit a468b70
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public void Search(SearchOption searchOption)
/// <param name="beatmap"></param>
/// <param name="onFinish"></param>
/// <param name="onFail"></param>
public void SearchByNeteaseID(int id, WorkingBeatmap beatmap, Action<APILyricResponseRoot> onFinish, Action<string> onFail)
public void SearchByNeteaseID(long id, WorkingBeatmap beatmap, Action<APILyricResponseRoot> onFinish, Action<string> onFail)
{
//处理之前的请求
cancellationTokenSource?.Cancel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void onRefreshComplete()

#endregion

public bool OnlineIDHaveDefinition(int onlineID, out int neteaseID)
public bool OnlineIDHaveDefinition(int onlineID, out long neteaseID)
{
neteaseID = -1;

Expand All @@ -140,7 +140,7 @@ public bool OnlineIDHaveDefinition(int onlineID, out int neteaseID)
return result != null;
}

public bool BeatmapMetaHaveDefinition(BeatmapInfo bi, out int neteaseID)
public bool BeatmapMetaHaveDefinition(BeatmapInfo bi, out long neteaseID)
{
neteaseID = -1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void ReplaceLyricWith(List<Lyric> newList, bool saveToDisk)
CurrentStatus.Value = Status.Finish;
}

public void GetLyricFor(int id)
public void GetLyricFor(long id)
{
CurrentStatus.Value = Status.Working;
LyricProcessor.SearchByNeteaseID(id, CurrentWorkingBeatmap, onLyricRequestFinished, onLyricRequestFail);
Expand Down Expand Up @@ -283,7 +283,7 @@ public void RefreshLyric(bool noLocalFile = false)
currentResponseRoot = null;
CurrentLine = null;

if (UserDefinitionHelper.BeatmapMetaHaveDefinition(CurrentWorkingBeatmap.BeatmapInfo, out int neid))
if (UserDefinitionHelper.BeatmapMetaHaveDefinition(CurrentWorkingBeatmap.BeatmapInfo, out long neid))
GetLyricFor(neid);
else if (UserDefinitionHelper.OnlineIDHaveDefinition(CurrentWorkingBeatmap.BeatmapSetInfo.OnlineID, out neid))
GetLyricFor(neid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class APIBeatmapLyricMapping : IDisposable
/// 目标歌曲的网易云ID
/// </summary>
[JsonProperty("Target")]
public int TargetNeteaseID { get; set; }
public long TargetNeteaseID { get; set; }

/// <summary>
/// 对应的谱面
Expand Down

0 comments on commit a468b70

Please sign in to comment.