bug fixes

This commit is contained in:
2dust
2023-02-15 20:13:20 +08:00
parent 9ef371ed40
commit 01423c9fb3
2 changed files with 11 additions and 3 deletions

View File

@@ -506,6 +506,10 @@ namespace clashN.Handler
{
profileItem.indexId = Utils.GetGUID(false);
}
if (profileItem.coreType is null)
{
profileItem.coreType = ECoreType.clash_meta;
}
if (!config.profileItems.Exists(it => it.indexId == profileItem.indexId))
{
var maxSort = config.profileItems.Any() ? config.profileItems.Max(t => t.sort) : 0;
@@ -564,7 +568,7 @@ namespace clashN.Handler
{
groupId = groupId,
url = clipboardData,
coreType = ECoreType.clash,
coreType = ECoreType.clash_meta,
address = string.Empty,
enabled = true,
remarks = "clash_subscription"
@@ -586,7 +590,7 @@ namespace clashN.Handler
{
groupId = groupId,
url = query["url"],
coreType = ECoreType.clash,
coreType = ECoreType.clash_meta,
address = string.Empty,
enabled = true,
remarks = "clash_subscription"
@@ -604,7 +608,7 @@ namespace clashN.Handler
{
groupId = groupId,
url = "",
coreType = ECoreType.clash,
coreType = ECoreType.clash_meta,
address = string.Empty,
enabled = false,
remarks = "clash_local_file"

View File

@@ -716,6 +716,10 @@ namespace clashN
var task = taskService.NewTask();
task.RegistrationInfo.Description = taskDescription;
task.Settings.DisallowStartIfOnBatteries = false;
task.Settings.StopIfGoingOnBatteries = false;
task.Settings.RunOnlyIfIdle = false;
task.Settings.IdleSettings.StopOnIdleEnd = false;
task.Settings.ExecutionTimeLimit = TimeSpan.Zero;
task.Triggers.Add(new LogonTrigger { UserId = logonUser, Delay = TimeSpan.FromMinutes(1) });
task.Principal.RunLevel = TaskRunLevel.Highest;
task.Actions.Add(new ExecAction(deamonFileName));