Skip to content

Commit

Permalink
优化文件名读取
Browse files Browse the repository at this point in the history
  • Loading branch information
nilaoda committed Jun 18, 2023
1 parent c8e4420 commit 8743a06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace N_m3u8DL_RE.CommandLine
{
internal partial class CommandInvoker
{
public const string VERSION_INFO = "N_m3u8DL-RE (Beta version) 20230615";
public const string VERSION_INFO = "N_m3u8DL-RE (Beta version) 20230617";

[GeneratedRegex("((best|worst)\\d*|all)")]
private static partial Regex ForStrRegex();
Expand Down
11 changes: 6 additions & 5 deletions src/N_m3u8DL-RE/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ static async Task DoWorkAsync(MyOption option)
//可选字幕轨道
var subs = lists.Where(x => x.MediaType == MediaType.SUBTITLES);

//尝试从URL或文件读取文件名
if (string.IsNullOrEmpty(option.SaveName))
{
option.SaveName = OtherUtil.GetFileNameFromInput(option.Input);
}

//生成文件夹
var tmpDir = Path.Combine(option.TmpDir ?? Environment.CurrentDirectory, $"{option.SaveName ?? DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}");
//记录文件
Expand Down Expand Up @@ -310,11 +316,6 @@ static async Task DoWorkAsync(MyOption option)
Console.ReadKey();
#endif

//尝试从URL或文件读取文件名
if (string.IsNullOrEmpty(option.SaveName))
{
option.SaveName = OtherUtil.GetFileNameFromInput(option.Input);
}

Logger.InfoMarkUp(ResString.saveName + $"[deepskyblue1]{option.SaveName.EscapeMarkup()}[/]");

Expand Down

0 comments on commit 8743a06

Please sign in to comment.