From 17e64976b705f07d6b5be1007983d7bfb7c12029 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 12 Feb 2023 19:42:18 +0800 Subject: [PATCH] fix #423 : Change int to string to avoid overflow exception --- CHANGELOG.md | 4 +++- common.props | 2 +- .../BiliBiliAgent/Interfaces/ILiveApi.cs | 2 +- src/Ray.BiliBiliTool.Console/appsettings.json | 2 +- src/Ray.BiliBiliTool.DomainService/LiveDomainService.cs | 2 +- test/BiliAgentTest/LiveApiTest.cs | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c46da5bf6..7d7b15df1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -89,4 +89,6 @@ - Feature #396 : Publish docker image to GitHub pkg ## 0.4.4 - Fix #228 : Try to fix sharing video error -- Feature: Change default docker image from dockerhub to github \ No newline at end of file +- Feature: Change default docker image from dockerhub to github +## 0.4.5 +- Fix #423 : Change int to string to avoid overflow exception \ No newline at end of file diff --git a/common.props b/common.props index 63714c814..314af312e 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ Ray - 0.4.4 + 0.4.5 $(NoWarn);CS1591;CS0436 diff --git a/src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/ILiveApi.cs b/src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/ILiveApi.cs index c09372450..d097dcbb1 100644 --- a/src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/ILiveApi.cs +++ b/src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/ILiveApi.cs @@ -107,7 +107,7 @@ public interface ILiveApi : IBiliBiliApi [Header("Referer", "https://live.bilibili.com/")] [Header("Origin", "https://live.bilibili.com")] [HttpGet("/xlive/web-ucenter/user/MedalWall?target_id={userId}")] - Task> GetMedalWall(int userId); + Task> GetMedalWall(string userId); /// /// 佩戴粉丝勋章 diff --git a/src/Ray.BiliBiliTool.Console/appsettings.json b/src/Ray.BiliBiliTool.Console/appsettings.json index 40401d234..48061223e 100644 --- a/src/Ray.BiliBiliTool.Console/appsettings.json +++ b/src/Ray.BiliBiliTool.Console/appsettings.json @@ -1,5 +1,5 @@ { - "RunTasks": "Daily", //要运行的任务名称[Daily,LiveLottery,UnfollowBatched,VipBigPoint,Test],多个使用&分隔,如“Daily&LiveLottery”,建议使用命令行参数指定 + "RunTasks": "Test", //要运行的任务名称[Daily,LiveLottery,UnfollowBatched,VipBigPoint,Test],多个使用&分隔,如“Daily&LiveLottery”,建议使用命令行参数指定 //程序自定义个性化配置 "DailyTaskConfig": { diff --git a/src/Ray.BiliBiliTool.DomainService/LiveDomainService.cs b/src/Ray.BiliBiliTool.DomainService/LiveDomainService.cs index 345028167..b529e54d6 100644 --- a/src/Ray.BiliBiliTool.DomainService/LiveDomainService.cs +++ b/src/Ray.BiliBiliTool.DomainService/LiveDomainService.cs @@ -568,7 +568,7 @@ public void LikeFansMedalLive() private List GetFansMedalInfoList() { _logger.LogInformation("【获取直播列表】获取拥有粉丝牌的直播列表"); - var medalWallInfo = this._liveApi.GetMedalWall(int.Parse(this._biliCookie.UserId)).Result; + var medalWallInfo = _liveApi.GetMedalWall(_biliCookie.UserId).Result; if (medalWallInfo.Code != 0) { diff --git a/test/BiliAgentTest/LiveApiTest.cs b/test/BiliAgentTest/LiveApiTest.cs index 48acde41b..872a79fd4 100644 --- a/test/BiliAgentTest/LiveApiTest.cs +++ b/test/BiliAgentTest/LiveApiTest.cs @@ -91,7 +91,7 @@ public void GetMedalWall_Normal_Success() var ck = scope.ServiceProvider.GetRequiredService(); var api = scope.ServiceProvider.GetRequiredService(); - BiliApiResponse re = api.GetMedalWall(919174).Result; + BiliApiResponse re = api.GetMedalWall("919174").Result; Assert.NotEmpty(re.Data.List);