Merge pull request #160 from Bililive/dev

Release 1.2.2
This commit is contained in:
Genteure 2021-01-29 21:28:04 +08:00 committed by GitHub
commit 815189c645
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 50 additions and 29 deletions

View File

@ -12,9 +12,9 @@ namespace BililiveRecorder.Cli
{
internal class Program
{
private static int Main()
private static int Main(string[] args)
=> Parser.Default
.ParseArguments<CmdVerbConfigMode, CmdVerbPortableMode>(Environment.GetCommandLineArgs())
.ParseArguments<CmdVerbConfigMode, CmdVerbPortableMode>(args)
.MapResult<CmdVerbConfigMode, CmdVerbPortableMode, int>(RunConfigMode, RunPortableMode, err => 1);
private static int RunConfigMode(CmdVerbConfigMode opts)

View File

@ -260,7 +260,7 @@ namespace BililiveRecorder.FlvProcessor
if (this.CuttingMode != AutoCuttingMode.Disabled && tag.IsVideoKeyframe)
{
bool byTime = (this.CuttingMode == AutoCuttingMode.ByTime) && (this.CurrentMaxTimestamp / 1000 >= this.CuttingNumber * 60);
bool bySize = (this.CuttingMode == AutoCuttingMode.BySize) && ((this._targetFile.Length / 1024 / 1024) >= this.CuttingNumber);
bool bySize = (this.CuttingMode == AutoCuttingMode.BySize) && (((this._targetFile?.Length ?? 0) / 1024 / 1024) >= this.CuttingNumber);
if (byTime || bySize)
{
this.FinallizeCurrentFile();

View File

@ -87,8 +87,9 @@ namespace BililiveRecorder.WPF
private void Application_SessionEnding(object sender, SessionEndingCancelEventArgs e)
{
if (e != null)
e.Cancel = true;
(Current.MainWindow as NewMainWindow).CloseWithoutConfirmAction();
(Current.MainWindow as NewMainWindow)?.CloseWithoutConfirmAction();
}
}
}

View File

@ -18,12 +18,12 @@
<attribute name='pid' layout='${processid}'/>
<attribute name='logger' layout='${logger}'/>
<attribute name='roomid' layout='${event-properties:item=roomid}'/>
<attribute name='message' layout='${message}'/>
<attribute name='exception' encode='false'>
<attribute name='message' escapeUnicode="false" layout='${message}'/>
<attribute name='exception' escapeUnicode="false" encode='false'>
<layout xsi:type='JsonLayout'>
<attribute name='type' layout='${exception:format=Type}'/>
<attribute name='message' layout='${exception:format=Message}'/>
<attribute name='tostring' layout='${exception:format=ToString}'/>
<attribute name='type' escapeUnicode="false" layout='${exception:format=Type}'/>
<attribute name='message' escapeUnicode="false" layout='${exception:format=Message}'/>
<attribute name='tostring' escapeUnicode="false" layout='${exception:format=ToString}'/>
</layout>
</attribute>
</layout>

View File

@ -18,12 +18,12 @@
<attribute name='pid' layout='${processid}'/>
<attribute name='logger' layout='${logger}'/>
<attribute name='roomid' layout='${event-properties:item=roomid}'/>
<attribute name='message' layout='${message}'/>
<attribute name='exception' encode='false'>
<attribute name='message' escapeUnicode="false" layout='${message}'/>
<attribute name='exception' escapeUnicode="false" encode='false'>
<layout xsi:type='JsonLayout'>
<attribute name='type' layout='${exception:format=Type}'/>
<attribute name='message' layout='${exception:format=Message}'/>
<attribute name='tostring' layout='${exception:format=ToString}'/>
<attribute name='type' escapeUnicode="false" layout='${exception:format=Type}'/>
<attribute name='message' escapeUnicode="false" layout='${exception:format=Message}'/>
<attribute name='tostring' escapeUnicode="false" layout='${exception:format=ToString}'/>
</layout>
</attribute>
</layout>

View File

@ -110,6 +110,8 @@ namespace BililiveRecorder.WPF.Pages
private async void RoomCard_DeleteRequested(object sender, EventArgs e)
{
if (this.DataContext is IRecorder rec && sender is IRecordedRoom room)
{
try
{
var dialog = new DeleteRoomConfirmDialog
{
@ -124,6 +126,8 @@ namespace BililiveRecorder.WPF.Pages
rec.SaveConfigToFile();
}
}
catch (Exception) { }
}
}
private async void RoomCard_ShowSettingsRequested(object sender, EventArgs e)
@ -148,26 +152,42 @@ namespace BililiveRecorder.WPF.Pages
roomid = result2;
}
else
{
try
{
await new AddRoomFailedDialog { DataContext = AddRoomFailedDialog.AddRoomFailedErrorText.InvalidInput }.ShowAsync();
}
catch (Exception) { }
return;
}
}
if (roomid < 0)
{
try
{
await new AddRoomFailedDialog { DataContext = AddRoomFailedDialog.AddRoomFailedErrorText.RoomIdNegative }.ShowAsync();
}
catch (Exception) { }
return;
}
else if (roomid == 0)
{
try
{
await new AddRoomFailedDialog { DataContext = AddRoomFailedDialog.AddRoomFailedErrorText.RoomIdZero }.ShowAsync();
}
catch (Exception) { }
return;
}
if (rec.Any(x => x.RoomId == roomid || x.ShortRoomId == roomid))
{
try
{
await new AddRoomFailedDialog { DataContext = AddRoomFailedDialog.AddRoomFailedErrorText.Duplicate }.ShowAsync();
}
catch (Exception) { }
return;
}

View File

@ -243,7 +243,7 @@
<value>監視</value>
</data>
<data name="RoomListPage_Menu_AutoRecord_DisableAll" xml:space="preserve">
<value>すべてのチャンネルの自動録画を停止する</value>
<value>すべての配信ルームの自動録画機能をキャンセル</value>
</data>
<data name="RoomListPage_Menu_AutoRecord_EnableAll" xml:space="preserve">
<value>すべての配信ルームの自動録画機能を起動</value>

View File

@ -1 +1 @@
1.2.1
1.2.2