Skip to content
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

[待讨论] 关于对 UID 进行持久化的提议 #223

Open
renbaoshuo opened this issue Dec 23, 2023 · 0 comments · May be fixed by #241
Open

[待讨论] 关于对 UID 进行持久化的提议 #223

renbaoshuo opened this issue Dec 23, 2023 · 0 comments · May be fixed by #241
Assignees

Comments

@renbaoshuo
Copy link
Member

renbaoshuo commented Dec 23, 2023

背景与问题

目前看到了一些使用 OIerDb NG 的 UID 对自己进行标识的做法,但在当前 OIerDb NG 的实现中,对于某位特定选手而言,其 UID 并不固定,因此存在一定风险。

实现方案

新建一个 contestants.txt(也可以是其他名字比如 oiers.txt),其中记录以下内容:

姓名,性别,拼音,获奖记录ID1,获奖记录ID2,获奖记录ID3,...
张三,男,zhang1-san1,1,1234,1926
...

其中获奖记录 ID 对应 raw.txt 中的行号(去除注释行后)或其他可以锚定特定获奖记录的标识符。

在进行合并、拆分选手时的操作流程与 schools.txt 类似,即删除条目时将该行置空而不删除,新增条目时直接添加到文件末尾。

此外,在完成这项工作后,后续应该可以安全地删除 raw.txt 中在合并/拆分选手、修改拼音时所做的特殊标记。

优点

  • 使选手的 UID 变得唯一且固定;
  • 简化了选手合并、拆分的流程,同时也减小了再次拆分合并后的选手的概率;
  • 便于修正选手相关信息,而无需对其名下的每条获奖记录都进行处理。

实现进度

草案,待讨论。

后记

由于本人目前正处高三复习阶段,因此对本条 issue 的回复可能会不太及时,同时应该也没有时间亲自实现这个草案。

如果有其他更好的想法,欢迎在评论区指出。

@renbaoshuo renbaoshuo pinned this issue Dec 23, 2023
@yhx-12243 yhx-12243 unpinned this issue Dec 25, 2023
@yhx-12243 yhx-12243 pinned this issue Dec 25, 2023
@renbaoshuo renbaoshuo self-assigned this Feb 6, 2024
renbaoshuo added a commit that referenced this issue Feb 6, 2024
This commit is the first part of the implement of issue #223.
@renbaoshuo renbaoshuo linked a pull request Feb 6, 2024 that will close this issue
4 tasks
@renbaoshuo renbaoshuo linked a pull request Feb 6, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant