Skip to content

Commit

Permalink
修复文件命名格式化BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
nilaoda committed May 29, 2023
1 parent 766fc41 commit 106a389
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions BBDown/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -624,12 +624,11 @@ private static async Task DoWorkAsync(MyOption myOption)
}
if (infoMode) continue;

LogDebug("Format Before: " + savePathFormat);
savePath = FormatSavePath(savePathFormat, title, videoTracks.ElementAtOrDefault(vIndex), audioTracks.ElementAtOrDefault(aIndex), p, pagesCount, tvApi, appApi, intlApi);
LogDebug("Format After: " + savePath);

if (downloadDanmaku)
{
LogDebug("Format Before: " + savePathFormat);
savePath = FormatSavePath(savePathFormat, title, videoTracks.ElementAtOrDefault(vIndex), audioTracks.ElementAtOrDefault(aIndex), p, pagesCount, tvApi, appApi, intlApi);
LogDebug("Format After: " + savePath);
var danmakuXmlPath = savePath[..savePath.LastIndexOf('.')] + ".xml";
var danmakuAssPath = savePath[..savePath.LastIndexOf('.')] + ".ass";
Log("正在下载弹幕Xml文件");
Expand Down Expand Up @@ -684,6 +683,10 @@ private static async Task DoWorkAsync(MyOption myOption)
selected = true;
}

LogDebug("Format Before: " + savePathFormat);
savePath = FormatSavePath(savePathFormat, title, videoTracks.ElementAtOrDefault(vIndex), audioTracks.ElementAtOrDefault(aIndex), p, pagesCount, tvApi, appApi, intlApi);
LogDebug("Format After: " + savePath);

Log($"已选择的流:");
if (videoTracks.Count > 0)
{
Expand Down Expand Up @@ -737,7 +740,6 @@ private static async Task DoWorkAsync(MyOption myOption)

if (videoTracks.Count > 0)
{

if (!infoMode && File.Exists(savePath) && new FileInfo(savePath).Length != 0)
{
Log($"{savePath}已存在, 跳过下载...");
Expand Down

0 comments on commit 106a389

Please sign in to comment.