修复bug: 若skip-merge和save-dir同时使用,则save-dir不能生效#817
Open
caiqingzhi2020 wants to merge 5 commits intonilaoda:mainfrom
Open
修复bug: 若skip-merge和save-dir同时使用,则save-dir不能生效#817caiqingzhi2020 wants to merge 5 commits intonilaoda:mainfrom
caiqingzhi2020 wants to merge 5 commits intonilaoda:mainfrom
Conversation
新增插件管理器(PluginConfigjson 加PluginManager.cs) 新增批量下载插件(BatchDownloadPlugin.cs加PluginConfigjson) 但ProxySwitcherPlugin.cs和UASwitcherplugin.cs还在开发中
…output目录,ProxySwitcherPlugin.cs UASwitcherPlugin.cs 归属于BatchDownloadPlugin
…rite,没有输出具体的异常信息(类型、消息、堆栈跟踪)- 修复 : 添加详细异常信息输出 修复问题2:位置 : Program.cs 中的批量下载日志输出 -原因 : 使用了 Logger.InfoMarkUp() 输出包含 [BatchDownload] 标记的日志,但 Spectre.Console 不识别这种自定义样式标记- 修复 : 将所有相关日志改为使用 Logger.Info() 和 Logger.Error()
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.
问题分析
根据源码分析,当使用 --skip-merge 参数时,程序SimpleDownloadManager.cs存在以下问题:
跳过合并步骤:当 SkipMerge 为 true 时,程序直接跳过合并逻辑,不会执行文件合并操作。
文件保存逻辑问题:在 SkipMerge 为 true 的情况下,程序只检查合并后的输出文件是否存在,但不会将分片文件保存到指定的输出目录。
临时文件清理:程序在 SkipMerge 为 false 时会删除临时文件,但在 SkipMerge 为 true 时没有相应的文件保存逻辑
关键源码问题
在 /workspace/N_m3u8DL-RE-src/src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs 中:
// 记录所有文件信息
if (File.Exists(output))
{
OutputFiles.Add(new OutputFile()
{
Index = task.Id,
FilePath = output,
LangCode = streamSpec.Language,
Description = streamSpec.Name,
Mediainfos = mediaInfos,
MediaType = streamSpec.MediaType,
});
}
问题:这段代码只在合并后的输出文件存在时才记录文件信息.当 SkipMerge 为 true 时, output 文件不存在,因此不会记录任何文件信息,导致下载的分片文件没有被保存到指定位置
解决措施见代码注释.以上仅个人见解,希望老大采纳