Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gwnpeter committed Feb 19, 2023
1 parent e2826fe commit 695bf15
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
17 changes: 9 additions & 8 deletions ncmdumpGUI/Main.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Threading;
using System.Windows.Forms;

namespace ncmdumpGUI
{
Expand Down Expand Up @@ -146,6 +139,14 @@ private void ConvertProc()

try
{
if (!ncmDirctoryInfo.Exists)
{
throw new Exception("ncm目录不存在");
}
if (!mp3DirctoryInfo.Exists)
{
mp3DirctoryInfo.Create();
}
foreach (FileInfo fileInfo in ncmDirctoryInfo.GetFiles("*.ncm"))
{
BeginInvoke(progressDialogControl.delProgressDlg, ProgressStatusType.BackgroundWorkUpdate, "转换:" + fileInfo.Name);
Expand Down
7 changes: 7 additions & 0 deletions ncmdumpGUI/NeteaseCrypto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ public void Dump(string destDir)
// 将.ncm替换成最终转换的文件后缀名
string destFileName = string.Format("{0}.{1}", _fileInfo.Name.Substring(0, _fileInfo.Name.Length - 4), this._cdata.Format);
string destFilePath = Path.Combine(destDir, destFileName);
var info = new FileInfo(destFilePath);
if (info.Exists)
{
//throw new Exception("file exists");
return;
}

using (FileStream stream = new FileStream(destFilePath, FileMode.OpenOrCreate, FileAccess.Write))
{
Expand All @@ -161,6 +167,7 @@ public void Dump(string destDir)

_progress = (alreadyProcess / totalLen) * 100d;
}
stream.Close();
}

// 写入专辑封面
Expand Down
4 changes: 2 additions & 2 deletions ncmdumpGUI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.1.0")]
[assembly: AssemblyFileVersion("1.3.1.0")]
[assembly: AssemblyVersion("1.3.2.0")]
[assembly: AssemblyFileVersion("1.3.2.0")]

0 comments on commit 695bf15

Please sign in to comment.