mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-11-15 19:22:19 +08:00
commit
815189c645
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -87,8 +87,9 @@ namespace BililiveRecorder.WPF
|
|||
|
||||
private void Application_SessionEnding(object sender, SessionEndingCancelEventArgs e)
|
||||
{
|
||||
e.Cancel = true;
|
||||
(Current.MainWindow as NewMainWindow).CloseWithoutConfirmAction();
|
||||
if (e != null)
|
||||
e.Cancel = true;
|
||||
(Current.MainWindow as NewMainWindow)?.CloseWithoutConfirmAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -111,18 +111,22 @@ namespace BililiveRecorder.WPF.Pages
|
|||
{
|
||||
if (this.DataContext is IRecorder rec && sender is IRecordedRoom room)
|
||||
{
|
||||
var dialog = new DeleteRoomConfirmDialog
|
||||
try
|
||||
{
|
||||
DataContext = room
|
||||
};
|
||||
var dialog = new DeleteRoomConfirmDialog
|
||||
{
|
||||
DataContext = room
|
||||
};
|
||||
|
||||
var result = await dialog.ShowAsync();
|
||||
var result = await dialog.ShowAsync();
|
||||
|
||||
if (result == ContentDialogResult.Primary)
|
||||
{
|
||||
rec.RemoveRoom(room);
|
||||
rec.SaveConfigToFile();
|
||||
if (result == ContentDialogResult.Primary)
|
||||
{
|
||||
rec.RemoveRoom(room);
|
||||
rec.SaveConfigToFile();
|
||||
}
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,25 +153,41 @@ namespace BililiveRecorder.WPF.Pages
|
|||
}
|
||||
else
|
||||
{
|
||||
await new AddRoomFailedDialog { DataContext = AddRoomFailedDialog.AddRoomFailedErrorText.InvalidInput }.ShowAsync();
|
||||
try
|
||||
{
|
||||
await new AddRoomFailedDialog { DataContext = AddRoomFailedDialog.AddRoomFailedErrorText.InvalidInput }.ShowAsync();
|
||||
}
|
||||
catch (Exception) { }
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (roomid < 0)
|
||||
{
|
||||
await new AddRoomFailedDialog { DataContext = AddRoomFailedDialog.AddRoomFailedErrorText.RoomIdNegative }.ShowAsync();
|
||||
try
|
||||
{
|
||||
await new AddRoomFailedDialog { DataContext = AddRoomFailedDialog.AddRoomFailedErrorText.RoomIdNegative }.ShowAsync();
|
||||
}
|
||||
catch (Exception) { }
|
||||
return;
|
||||
}
|
||||
else if (roomid == 0)
|
||||
{
|
||||
await new AddRoomFailedDialog { DataContext = AddRoomFailedDialog.AddRoomFailedErrorText.RoomIdZero }.ShowAsync();
|
||||
try
|
||||
{
|
||||
await new AddRoomFailedDialog { DataContext = AddRoomFailedDialog.AddRoomFailedErrorText.RoomIdZero }.ShowAsync();
|
||||
}
|
||||
catch (Exception) { }
|
||||
return;
|
||||
}
|
||||
|
||||
if (rec.Any(x => x.RoomId == roomid || x.ShortRoomId == roomid))
|
||||
{
|
||||
await new AddRoomFailedDialog { DataContext = AddRoomFailedDialog.AddRoomFailedErrorText.Duplicate }.ShowAsync();
|
||||
try
|
||||
{
|
||||
await new AddRoomFailedDialog { DataContext = AddRoomFailedDialog.AddRoomFailedErrorText.Duplicate }.ShowAsync();
|
||||
}
|
||||
catch (Exception) { }
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user