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

bgmi update: 添加指定weekday下载 #779

Open
wants to merge 13 commits into
base: v5
Choose a base branch
from

Conversation

luminousvilax
Copy link

  • bgmi update 添加可指定weekday进行下载
  • 添加bgmi change 自定义番剧的更新日期
  • 添加对应的测试用例

Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: Patch coverage is 92.70073% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 80.88%. Comparing base (1ca8d3f) to head (1bce888).

Files Patch % Lines
bgmi/lib/update.py 18.18% 9 Missing ⚠️
bgmi/lib/controllers.py 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               v5     #779      +/-   ##
==========================================
- Coverage   82.30%   80.88%   -1.42%     
==========================================
  Files          44       39       -5     
  Lines        2842     2909      +67     
==========================================
+ Hits         2339     2353      +14     
- Misses        503      556      +53     
Flag Coverage Δ
downloader ?
e2e 77.43% <82.47%> (+0.28%) ⬆️
unit 65.31% <77.98%> (+0.50%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@trim21
Copy link
Member

trim21 commented Jan 31, 2024

确定是v5分支吗?

@luminousvilax
Copy link
Author

嗯,我看v5和master区别有点大,就在v5上面写的,免得以后不好合

@luminousvilax
Copy link
Author

少了个update --recent的用例,我再补下吧

@trim21
Copy link
Member

trim21 commented Feb 9, 2024

加新数据库字段的话需要写个数据库迁移SQL

@trim21
Copy link
Member

trim21 commented Feb 9, 2024

这个change命令感觉没啥必要(

@luminousvilax
Copy link
Author

加新数据库字段的话需要写个数据库迁移SQL

应该在哪写呢,我看upgrade那里是直接重建的(
上面有个exec_sql()但是没看到调用,我当时也比较疑惑

BGmi/bgmi/lib/update.py

Lines 24 to 43 in 1ca8d3f

def update_database() -> None:
if not old_version_file.exists():
old_version_file.write_text(__version__, encoding="utf8")
return
previous = packaging.version.parse(old_version_file.read_text(encoding="utf8").strip())
if previous < packaging.version.Version("5.0.0a0"):
print_error(
(
"can't automatically upgrade from <5.0.0 version, "
+ " please backup your .bgmi files, remove them and use `bgmi install`\n"
+ RED
+ "All Data will lost, you will need to re-add your bangumi after re-install"
+ COLOR_END
),
stop=True,
)
# all upgrade done, write current version
old_version_file.write_text(__version__, encoding="utf8")

@trim21
Copy link
Member

trim21 commented Feb 20, 2024

先判断之前的版本号,然后用exec_sql

@luminousvilax
Copy link
Author

这个change命令感觉没啥必要(

我的想法是配合update --recent使用的,因为我发现bgmi cal得到的update_day有部分和我需求不一样,比如有些番字幕组更的晚一两天,有的是源站排的不一样(比较少),这些情况可以自己调整一下
然后定时任务平时update --recent,一段时间跑一次全量,可能会比较好?
当然直接默认全量更新的话,不需要折腾这些(

@trim21
Copy link
Member

trim21 commented Feb 20, 2024

这个change命令感觉没啥必要(

我的想法是配合update --recent使用的,因为我发现bgmi cal得到的update_day有部分和我需求不一样,比如有些番字幕组更的晚一两天,有的是源站排的不一样(比较少),这些情况可以自己调整一下 然后定时任务平时update --recent,一段时间跑一次全量,可能会比较好? 当然直接默认全量更新的话,不需要折腾这些(

你会Python的话我建议你自己写个脚本替代掉默认的update命令,因为你加的这两个我都感觉没什么必要…

@luminousvilax
Copy link
Author

这个change命令感觉没啥必要(

我的想法是配合update --recent使用的,因为我发现bgmi cal得到的update_day有部分和我需求不一样,比如有些番字幕组更的晚一两天,有的是源站排的不一样(比较少),这些情况可以自己调整一下 然后定时任务平时update --recent,一段时间跑一次全量,可能会比较好? 当然直接默认全量更新的话,不需要折腾这些(

你会Python的话我建议你自己写个脚本替代掉默认的update命令,因为你加的这两个我都感觉没什么必要…

是没什么必要,其实就是想着给有同样需求的人用嘛,所以都是在不影响原有功能的基础上加的

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.

None yet

2 participants