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

优化课程和番剧 EP/SS ID 解析,提升用户体验 #919

Merged
merged 2 commits into from
Aug 14, 2024

Conversation

lc6464
Copy link
Contributor

@lc6464 lc6464 commented Aug 13, 2024

主要更改

  1. 增强 GetVideoInfoAsync 方法:
    • 当只输入 EP/SS ID 时,先尝试按番剧查找,如果找不到则尝试按课程查找
    • 添加了相应的错误处理和日志输出,提高用户体验
  2. 扩展 GetAvIdAsync 方法:
    • 新增对 ^cheese/(ep|ss)\d+ 格式的支持(正则表达式仅作为提示)
  3. 代码优化:
    • 更新了部分注释,提高代码可读性
    • 微调了日志输出的位置,使其更加合理

技术细节

  • GetVideoInfoAsync 中,通过捕获 KeyNotFoundException 来判断是否需要尝试按课程查找
  • GetAvIdAsync 中,新增了对 cheese/ 开头 URL 的处理逻辑

未来优化建议

  1. 考虑添加 .editorconfig 文件,规范化代码格式,便于不同开发者在各自的 IDE 或编辑器中保持一致的代码风格
  2. 建议使用代码分析工具(如 DeepSource)和 Visual Studio 的分析功能,处理项目中的警告和提示,进一步提高代码质量

测试

  • 测试番剧 EP/SS ID 解析(测试了 ep5737ss281
  • 测试课程 EP/SS ID 解析(测试了 ep125811 cheese/ep125811 ep6173 cheese/ep6173cheese/ss281
  • 测试其他现有功能,确保未受影响(测试了几个完整的课程 EP URL)

相关问题

Copy link
Contributor Author

@lc6464 lc6464 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Program.cs 的缩进似乎是出了亿点大问题😢

BBDown/BBDownUtil.cs Outdated Show resolved Hide resolved
BBDown/Program.cs Outdated Show resolved Hide resolved
BBDown/Program.cs Outdated Show resolved Hide resolved
BBDown/Program.cs Outdated Show resolved Hide resolved
BBDown/Program.cs Outdated Show resolved Hide resolved
Copy link
Contributor Author

@lc6464 lc6464 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

现在这个 PR 是没问题了,但是原有代码中还有很多奇怪的格式问题,还是建议尽早引入 .editorconfig 和代码分析工具并优化相关代码。

@nilaoda nilaoda merged commit adf8d0b into nilaoda:master Aug 14, 2024
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.

<url>参数不能填写ep或ss号 需要填写完整url地址
2 participants