Skip to content

Commit

Permalink
fix(plugins/itodaysplus/): 本地已存在时不应该触发新增保存
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyungent committed Apr 8, 2023
1 parent 7386e7e commit 6046273
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugins/ITodaysPlus/ITodaysPlus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public async Task ExecuteAsync()
string dateRecordFilePath = Path.Combine(folderPath, dateRecordFileName);
Console.WriteLine($"{dateRecordFileName} - 尝试");

var dateRecordFileNames = folderDir.GetFiles("DateRecord-*.json")?.Select(m => m.FullName)?.ToArray();
var dateRecordFileNames = folderDir.GetFiles("DateRecord-*.json")?.Select(m => m.Name)?.ToArray();
if (dateRecordFileNames != null && !dateRecordFileNames.Contains(dateRecordFileName))
{
// 不存在此记录才 新增保存
Expand Down
4 changes: 2 additions & 2 deletions plugins/ITodaysPlus/ITodaysPlus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>PluginCore.ITodaysPlus</PackageId>
<Version>0.1.0</Version>
<FileVersion>0.1.0.0</FileVersion>
<Version>0.1.1</Version>
<FileVersion>0.1.1.0</FileVersion>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Company>yiyun</Company>
<Authors>yiyun</Authors>
Expand Down
2 changes: 1 addition & 1 deletion plugins/ITodaysPlus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


<!-- Matomo Image Tracker-->
<img referrerpolicy="no-referrer-when-downgrade" src="https://matomo.moeci.com/matomo.php?idsite=2&amp;rec=1&amp;action_name=Plugins.ITodaysPlus-v0.1.0.README" style="border:0" alt="" />
<img referrerpolicy="no-referrer-when-downgrade" src="https://matomo.moeci.com/matomo.php?idsite=2&amp;rec=1&amp;action_name=Plugins.ITodaysPlus-v0.1.1.README" style="border:0" alt="" />
<!-- End Matomo -->


Expand Down
10 changes: 9 additions & 1 deletion plugins/ITodaysPlus/Utils/ITodaysUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@ public LoginResponseModel Login(string userName, string password, string tmp_tok
resultModel.responseModel = System.Text.Json.JsonSerializer.Deserialize<DateRecordResponseModel>(jsonStr);
if (resultModel.responseModel.status == 1)
{
resultModel.dataModel = System.Text.Json.JsonSerializer.Deserialize<DateRecordResponseModel.dataModel>(resultModel.responseModel.data);
try
{
resultModel.dataModel = System.Text.Json.JsonSerializer.Deserialize<DateRecordResponseModel.dataModel>(resultModel.responseModel.data);
}
catch (Exception ex)
{
Console.WriteLine($"resultModel.responseModel.data: \n {resultModel.responseModel.data}");
throw ex;
}
}
}
catch (Exception ex)
Expand Down
2 changes: 1 addition & 1 deletion plugins/ITodaysPlus/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"DisplayName": "iTodayss+",
"Description": "提升 爱今天/时间朋友 体验",
"Author": "yiyun",
"Version": "0.1.0",
"Version": "0.1.1",
"SupportedVersions": [ "0.0.1" ]
}

0 comments on commit 6046273

Please sign in to comment.