8000 feat(github_releases): support dir size for show all version by YangRucheng · Pull Request #7938 · AlistGo/alist · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(github_releases): support dir size for show all version #7938

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

Merged
merged 3 commits into from
Feb 9, 2025

Conversation

YangRucheng
Copy link
Contributor
@YangRucheng YangRucheng commented Feb 4, 2025

配置项

配置项 类型 是否必填 描述 示例
RepoStructure text 仓库结构 alist-org/alist
ShowReadme bool 是否显示 *.mdLICENSE 文件
Token string GitHub 访问令牌,用于私有仓库 和 避免访问速率限制
ShowAllVersion bool 开启后以子目录的形式显示所有版本
GitHubProxy string 使用 gh-proxy https://ghproxy.net/github.com

本次修改内容

1. 修改 JSON 解析,支持统计目录大小

之前偷懒使用了 jsoniter.Get 动态访问 JSON 字段。我写统计所有版本的总文件大小时,发现耗时过久。
只统计 latest 总大小时耗时不明显,所以没注意到。(T_T)
改用 json.Unmarshal 解析到静态字段,再统计总大小,似乎能提升速度。
因此,本次 pr 也支持了显示所有版本时,统计目录大小。

2. 修复 显示所有版本时,LICENSE.md 的位置不恰当

之前,开启 显示所有版本显示 README 后:

alist/
├── v3.41.0/
│   ├── alist-linux-amd64.tar.gz
│   ├── alist-linux-amd64.tar.gz
│   ├── LICENSE
│   └── README.md
├── v3.40.0/
│   ├── alist-linux-amd64.tar.gz
│   ├── alist-linux-amd64.tar.gz
│   ├── LICENSE
│   └── README.md
└── v3.39.4/
    ├── alist-linux-amd64.tar.gz
    ├── alist-linux-amd64.tar.gz
    ├── LICENSE
    └── README.md

现在修改后:

alist/
├── v3.41.0/
│   ├── alist-linux-amd64.tar.gz
│   └── alist-windows-amd64.zip
├── v3.40.0/
│   ├── alist-linux-amd64.tar.gz
│   └── alist-windows-amd64.zip
├── v3.39.4/
│   ├── alist-linux-amd64.tar.gz
│   └── alist-windows-amd64.zip
├── LICENSE
└── README.md

3. 修改默认的 RepoStructure

修改为 alist-org/alist

4. 增加 gh-proxy 支持

填入 https://ghproxy.net/github.com
会将原下载链接 https://github.com/AlistGo/alist/releases/download/v3.42.0/alist-linux-amd64.tar.gz
替换为 https://ghproxy.net/github.com/AlistGo/alist/releases/download/v3.42.0/alist-linux-amd64.tar.gz

测试

本 pr 无兼容问题,以下写法均已自测。

alistGo/alist
/alist-gh:alistGo/alist
/alist-web-gh:alistGo/alist-web
/path/to/alist-gh:alistGo/alist
/path/to2/alist-web-gh:AlistGo/alist-web

测试镜像:docker.io/yangrucheng/alist:pr-7938

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
0