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

优化时间显示格式、错误处理、播放速度参数 #351

Merged
merged 2 commits into from
Sep 21, 2024

Conversation

isHarryh
Copy link
Contributor

  1. 7441be0 将时间显示格式 x min x s 调整为 xx:xx。这样做是因为 xx:xx 更符合用户阅读习惯(视频播放器均采用此时间格式);其次 xx:xx 的字符串长度是固定的,能使回显更加整齐、视觉跳动性更少。
    • 修复前 before
    • 修复后 after
  2. e6fbb7b 优化了错误处理和播放速度参数,具体而言:
    1. 先前的 Logger 只能记录继承于自定义的 exceptions.BaseException 基类的 LoginError 错误,而当其他意外错误发生时,Logger 无法对其进行记录,而是直接抛出异常导致终止程序。经过改动后,移除了自定义 exceptions.BaseException 基类(避免和内置 builtins.BaseException 混淆),并且 if __name__ == '__main__' 代码块内发生的所有继承于内置 builtins.BaseException 基类的异常都能够通过 Logger 打印错误信息和堆栈跟踪。
    2. 先前的命令行速度参数只能传入整数的播放速度,经过改动后,支持传入小数。先前对速度参数的输入限制只限制了最大值为 1,没有对下限进行检测,经过改动后,输入限制规范于 [1.0, 2.0]

@Samueli924 Samueli924 merged commit d5cf16e into Samueli924:main Sep 21, 2024
1 check passed
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 this pull request may close these issues.

2 participants