-
-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix announcement start time #1567
Conversation
@@ -2922,13 +2922,19 @@ | |||
<value>Weapon WIKI</value> | |||
</data> | |||
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve"> | |||
<value>(?:〓Event Duration〓|〓Quest Start Time〓).*?\d\.\dthe Version update(?:after|)Permanently available</value> | |||
<value>(?:〓Event Duration〓|〓Quest Start Time〓).*?Permanently.*?Version.*?(\d\.\d).*?update</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Masterain98 FYI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
正则表达的本地化能不能拆分到不同的文件
src/Snap.Hutao/Snap.Hutao/Service/Announcement/AnnouncementService.cs
Outdated
Show resolved
Hide resolved
WebAnnouncement? versionUpdate = announcementListWrappers | ||
.Single(wrapper => wrapper.TypeId == 2) | ||
.List | ||
.Single(ann => AnnouncementRegex.VersionUpdateTitleRegex.IsMatch(ann.Title)); | ||
.SingleOrDefault(ann => AnnouncementRegex.VersionUpdateTitleRegex.IsMatch(ann.Title)); | ||
|
||
if (AnnouncementRegex.VersionUpdateTimeRegex.Match(versionUpdate.Content) is not { Success: true } versionUpdateMatch) | ||
if (versionUpdate is not null) | ||
{ | ||
return; | ||
} | ||
if (AnnouncementRegex.VersionUpdateTimeRegex.Match(versionUpdate.Content) is not { Success: true } versionUpdateMatch) | ||
{ | ||
return; | ||
} | ||
|
||
DateTimeOffset versionUpdateTime = UnsafeDateTimeOffset.ParseDateTime(versionUpdateMatch.Groups[1].ValueSpan, offset); | ||
versionStartTimeDict.Add(VersionRegex().Match(versionUpdate.Title).Groups[1].Value, versionUpdateTime); | ||
DateTimeOffset versionUpdateTime = UnsafeDateTimeOffset.ParseDateTime(versionUpdateMatch.Groups[1].ValueSpan, offset); | ||
versionStartTimeDict.Add(VersionRegex().Match(versionUpdate.Title).Groups[1].Value, versionUpdateTime); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
更新公告是一定存在的,不存在不匹配的情况
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
正则式本地化好像有问题,韩语的公告就显示不出来
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个通过修改正则来修复,不然出来的时间也是错的,不显示在这里是intended
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
所以判断一下,这样最多只是显示的时间错了,不会出现没有公告的情况
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对于活动公告的准确性来说,我个人认为不太能接受
看其他reviewer吧
Hi @Natrium0521 感谢你对本项目的贡献,为了方便后续的交流你可以加入我们的开发交流群 |
Description
修复了在版本更新维护预告发布后,版本更新说明发布前,活动公告显示的开始时间错误的问题:
修改了部分语言提取公告时间的正则表达式。
Related Issue
Checklist
develop
branch