feat: 支持使用服务器提供的文件时间#46
Open
doraemonkeys wants to merge 1 commit into
Open
Conversation
新增设置 use_server_time(默认关闭):开启后完成文件的 mtime 设为服务器 提供的原始时间。HTTP 日期解析覆盖 RFC 9110 三种格式并剥离星期字段(容忍 服务器星期与日期不符);元数据写入尽力而为,失败仅记日志不影响下载结果。 配置管道覆盖桌面 App 与 headless server(启动加载 + 热更新),aria2 RPC 映射 remote-time 全局选项,设置页「下载」分类新增开关。 Closes zerx-lab#45
5002251 to
066f73d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #45
做了什么
新增设置「使用服务器文件时间」(默认关闭):开启后,下载完成的文件会把修改时间设为服务器响应的
Last-Modified原始时间,而不是下载完成时间。行为与 aria2 的--remote-time对齐,方便按文件时间管理版本的用户。实现要点
Last-Modified此前已作为续传一致性 validator 被捕获和持久化,本 PR 直接复用该值——在 finalize rename 之后设置文件 mtime(downloader.rs)。时间戳属于尽力而为的元数据:服务器未提供、解析失败或写入失败都只记日志,绝不影响下载结果。use_server_time,桌面 App 与 headless server 双侧支持启动加载 + 运行时热更新。remote-time映射到该配置,AriaNg 等客户端可直接读写。测试
Last-Modified,关闭时保持本地完成时间cargo fmt+clippy -D warnings干净,flutter analyze无新增告警范围外(可后续增量)
last_modified,自然跳过,不受影响)