From 0d68e55c644982118693cf97a05da80cff6decdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=B3=E9=88=9E?= Date: Tue, 22 Feb 2022 17:12:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=99=82=E9=96=93=E5=AD=97?= =?UTF-8?q?=E4=B8=B2=E8=A8=88=E7=AE=97=E9=8C=AF=E8=AA=A4=EF=BC=8C=E8=BC=B8?= =?UTF-8?q?=E5=87=BA=E6=AA=94=E5=90=8D=E5=8A=A0=E4=B8=8A=E6=99=82=E9=96=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Download.cs | 2 +- Form1.cs | 10 +++++----- Properties/PublishProfiles/ClickOnceProfile.pubxml | 5 ++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Download.cs b/Download.cs index 9fe89f6..5b7ef54 100644 --- a/Download.cs +++ b/Download.cs @@ -201,7 +201,7 @@ private string CalculatePath(string? title, DateTime? date) date ??= DateTime.Now; - string newPath = Path.Combine(outputDirectory.FullName, $"{date:yyyyMMdd} {title} ({id}).mp4"); + string newPath = Path.Combine(outputDirectory.FullName, $"{date:yyyyMMdd} {title} ({id}) [{start}_{end}].mp4"); Log.Debug("Calculate output file path as {newPath}", newPath); return newPath; diff --git a/Form1.cs b/Form1.cs index 57394ba..703bb69 100644 --- a/Form1.cs +++ b/Form1.cs @@ -158,13 +158,13 @@ private async Task DownloadAsync(string id, float start, float end, DirectoryInf Application.DoEvents(); } + MessageBox.Show($"Video segments are stored in:\n\n{download.outputFilePath}", "Finish"); + // Open save directory Process process = new(); process.StartInfo.UseShellExecute = true; process.StartInfo.FileName = directory.FullName; process.Start(); - - MessageBox.Show($"Video segments are stored in:\n\n{download.outputFilePath}", "Finish"); } catch (Exception e) { @@ -200,13 +200,13 @@ private static float ConvertTimeStringToSecond(string text) string time = timeList[i].Trim(); if (float.TryParse(time, out var t)) { - result += t * (i * 60); + result += (float)(t * Math.Pow(60, i)); } else { // Parse failed - result = 0; - break; + Log.Logger.Error("Cannot parse {time} to float number!", time); + return -1; } } } diff --git a/Properties/PublishProfiles/ClickOnceProfile.pubxml b/Properties/PublishProfiles/ClickOnceProfile.pubxml index 8bab60e..af25fce 100644 --- a/Properties/PublishProfiles/ClickOnceProfile.pubxml +++ b/Properties/PublishProfiles/ClickOnceProfile.pubxml @@ -4,8 +4,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - 5 - 1.1.0.* + 0 + 1.1.1.* True Release True @@ -39,7 +39,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Foreground False Publish.html - True|2022-02-22T06:39:00.2333859Z;