Skip to content

Commit

Permalink
build:1.1.2.0105
Browse files Browse the repository at this point in the history
- 优化:导航菜单显示 感谢@kat
- 优化:增加“介于”“不介于”条件的使用描述
- 优化:源目录允许用户手动输入路径(可以是文件/文件夹)
- 修复:某些情况下会发生间隔执行配置失败的问题 #56
- 禁用:加密功能需要优化,暂时不生效(下个版本恢复)
  • Loading branch information
SaboZhang committed Jan 4, 2025
1 parent db0f81a commit 7b0bf04
Show file tree
Hide file tree
Showing 23 changed files with 89 additions and 39 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@

# 更新(元旦)
# 更新(小寒)

[更新下载](https://github.com/SaboZhang/EasyTidy/releases)

- 优化:导航菜单显示 感谢@kat
- 优化:增加“介于”“不介于”条件的使用描述
- 优化:源目录允许用户手动输入路径(可以是文件/文件夹)
- 修复:某些情况下会发生间隔执行配置失败的问题 #56
- 禁用:加密功能需要优化,暂时不生效(下个版本恢复)

**Full Changelog**: <https://github.com/SaboZhang/EasyTidy/compare/1.1.0.1226...1.1.1.0101>
**网盘新增不包含winui跟.NET的版本,更新程序暂不支持更新不包含winui3AppSDK的版本**

**Full Changelog**: <https://github.com/SaboZhang/EasyTidy/compare/1.1.0.1226...1.1.2.0105>

网盘下载:[123网盘](https://www.123684.com/s/hbzgTd-fmmt)|[蓝奏云(2025)](https://wwoo.lanzouu.com/b02u2ne0eh)
4 changes: 2 additions & 2 deletions src/EasyTidy.Model/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace EasyTidy.Model;
public partial class AppConfig : JsonSettings, IVersionable
{
[EnforcedVersion("1.1.1.0101")]
public virtual Version Version { get; set; } = new Version(1, 1, 1, 0101);
[EnforcedVersion("1.1.2.0105")]
public virtual Version Version { get; set; } = new Version(1, 1, 2, 0105);

public override string FileName { get; set; } = Constants.AppConfigPath;

Expand Down
8 changes: 8 additions & 0 deletions src/EasyTidy.Service/FileActuator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ internal static async Task ProcessFileAsync(OperationParameters parameters)
break;
case OperationMode.Encryption:
// TODO: 加密文件
// await ExecuteEncryption(parameters.SourcePath, parameters.TargetPath, "123456");
break;
case OperationMode.HardLink:
CreateFileHardLink(parameters.SourcePath, parameters.TargetPath);
Expand Down Expand Up @@ -814,6 +815,13 @@ private static bool CreateHardLink(string hardLinkPath, string existingFilePath)
return result;
}

private static async Task ExecuteEncryption(string path, string target, string pass)
{

CryptoUtil.EncryptFile(path,target, pass);
await Task.CompletedTask;
}

/// <summary>
/// 检查文件夹是否为空
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions src/EasyTidy.Service/FileEventHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ private static void OnFileChange(FileSystemEventArgs e, int delaySeconds, Action
/// <param name="parameter"></param>
private static void HandleFileChange(string path, OperationParameters parameter)
{
if (string.IsNullOrEmpty(parameter.SourcePath))
{
LogService.Logger.Warn("源文件夹为空,此次自动任务将退出执行");
return;
}
try
{
if (!IsPathUnderWatch(parameter.SourcePath, parameter.TargetPath)) return;
Expand Down
12 changes: 11 additions & 1 deletion src/EasyTidy.Service/OperationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,23 @@ await Task.Run(async () =>
{
await FileActuator.ExecuteFileOperationAsync(parameters);
});
LogService.Logger.Info("执行加密任务完成");
}

private static async Task CreateSoftLink(OperationParameters parameters)
{
await Task.Run(async () =>
{
await FileActuator.ExecuteFileOperationAsync(parameters);
if (parameters.RuleModel.RuleType == TaskRuleType.FileRule)
{
await FileActuator.ExecuteFileOperationAsync(parameters);
}
else
{
await FolderActuator.ExecuteFolderOperationAsync(parameters);
}
});
LogService.Logger.Info("执行软连接任务完成");
}

private static async Task CreateHandLink(OperationParameters parameters)
Expand All @@ -285,6 +294,7 @@ await Task.Run(async () =>
{
await FileActuator.ExecuteFileOperationAsync(parameters);
});
LogService.Logger.Info("执行硬连接任务完成");
}

}
2 changes: 1 addition & 1 deletion src/EasyTidy.Util/FilterUtil.Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ internal static bool CompareValues(long fileValue, long? filterValue, long? filt
ComparisonResult.GreaterThan => fileValue > filterValue,
ComparisonResult.LessThan => fileValue < filterValue,
ComparisonResult.Equal => fileValue == filterValue,
ComparisonResult.Between => fileValue > filterValue && fileValue < filterValueTwo,
ComparisonResult.Between => fileValue >= filterValue && fileValue <= filterValueTwo,
ComparisonResult.NotBetween => fileValue < filterValue || fileValue > filterValueTwo,
_ => false,
};
Expand Down
2 changes: 1 addition & 1 deletion src/EasyTidy/Activation/DefaultActivationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected override bool CanHandleInternal(LaunchActivatedEventArgs args)

protected override async Task HandleInternalAsync(LaunchActivatedEventArgs args)
{
_navigationService.NavigateTo(typeof(FilterViewModel).FullName!, args.Arguments);
_navigationService.NavigateTo(typeof(TaskOrchestrationViewModel).FullName!, args.Arguments);

await Task.CompletedTask;
}
Expand Down
7 changes: 6 additions & 1 deletion src/EasyTidy/Common/Job/AutomaticJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using EasyTidy.Common.Database;
using EasyTidy.Model;
using EasyTidy.Service;
using EasyTidy.Util;
using Microsoft.EntityFrameworkCore;
using Quartz;

Expand All @@ -29,6 +28,12 @@ public async Task Execute(IJobExecutionContext context)
return;
}

if (string.IsNullOrEmpty(task.TaskSource))
{
Logger.Warn("源文件夹为空,此次自动任务将退出执行");
return;
}

var rule = await GetSpecialCasesRule(task.GroupName.Id, task.TaskRule);
var operationParameters = new OperationParameters(
operationMode: task.OperationMode,
Expand Down
3 changes: 2 additions & 1 deletion src/EasyTidy/EasyTidy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<Version>1.1.1.0101</Version>
<Version>1.1.2.0105</Version>
<ImplicitUsings>true</ImplicitUsings>
<SuportedOSPlatformsVersion>10.0.22621.0</SuportedOSPlatformsVersion>
<WindowsSdkPackageVersion>10.0.22621.45</WindowsSdkPackageVersion>
Expand All @@ -23,6 +23,7 @@
<WindowsPackageType>None</WindowsPackageType>
<DefaultLanguage>en-Us</DefaultLanguage>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>
<PropertyGroup Label="MultilingualAppToolkit">
<MultilingualAppToolkitVersion>4.0</MultilingualAppToolkitVersion>
Expand Down
4 changes: 2 additions & 2 deletions src/EasyTidy/MultilingualResources/EasyTidy.fr-FR.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
</trans-unit>
<trans-unit id="FilterSettingsControl.ModuleTitle" translate="yes" xml:space="preserve">
<source>Filter</source>
<target state="translated">Filtre</target>
<target state="translated">Avancé</target>
</trans-unit>
<trans-unit id="AtLeastOneWord" translate="yes" xml:space="preserve">
<source>At least one word</source>
Expand Down Expand Up @@ -1442,7 +1442,7 @@
</trans-unit>
<trans-unit id="NavFiltersText.Content" translate="yes" xml:space="preserve">
<source>Filters</source>
<target state="translated">Filters</target>
<target state="translated">Règles avancées</target>
</trans-unit>
<trans-unit id="NavGeneralText.Content" translate="yes" xml:space="preserve">
<source>General</source>
Expand Down
4 changes: 2 additions & 2 deletions src/EasyTidy/MultilingualResources/EasyTidy.ja-JP.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
</trans-unit>
<trans-unit id="FilterSettingsControl.ModuleTitle" translate="yes" xml:space="preserve">
<source>Filter</source>
<target state="translated">フィルタ</target>
<target state="translated">高級ルール</target>
</trans-unit>
<trans-unit id="AtLeastOneWord" translate="yes" xml:space="preserve">
<source>At least one word</source>
Expand Down Expand Up @@ -1442,7 +1442,7 @@
</trans-unit>
<trans-unit id="NavFiltersText.Content" translate="yes" xml:space="preserve">
<source>Filters</source>
<target state="translated">フィルタ</target>
<target state="translated">高級ルール</target>
</trans-unit>
<trans-unit id="NavGeneralText.Content" translate="yes" xml:space="preserve">
<source>General</source>
Expand Down
6 changes: 3 additions & 3 deletions src/EasyTidy/MultilingualResources/EasyTidy.zh-CN.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
</trans-unit>
<trans-unit id="FilterSettingsControl.ModuleTitle" translate="yes" xml:space="preserve">
<source>Filter</source>
<target state="translated">过滤器</target>
<target state="translated">高级规则</target>
</trans-unit>
<trans-unit id="AtLeastOneWord" translate="yes" xml:space="preserve">
<source>At least one word</source>
Expand Down Expand Up @@ -1430,11 +1430,11 @@
</trans-unit>
<trans-unit id="NavTaskOrchestrationText.Content" translate="yes" xml:space="preserve">
<source>Task Orchestration</source>
<target state="translated">任务编排</target>
<target state="translated">整理任务</target>
</trans-unit>
<trans-unit id="NavFiltersText.Content" translate="yes" xml:space="preserve">
<source>Filters</source>
<target state="translated">过滤规则</target>
<target state="translated">高级规则</target>
</trans-unit>
<trans-unit id="NavGeneralText.Content" translate="yes" xml:space="preserve">
<source>General</source>
Expand Down
2 changes: 1 addition & 1 deletion src/EasyTidy/MultilingualResources/EasyTidy.zh-Hant.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@
</trans-unit>
<trans-unit id="NavFiltersText.Content" translate="yes" xml:space="preserve">
<source>Filters</source>
<target state="translated">過濾器</target>
<target state="translated">高級規則</target>
</trans-unit>
<trans-unit id="NavGeneralText.Content" translate="yes" xml:space="preserve">
<source>General</source>
Expand Down
2 changes: 1 addition & 1 deletion src/EasyTidy/MultilingualResources/EasyTidy.zh-TW.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@
</trans-unit>
<trans-unit id="NavFiltersText.Content" translate="yes" xml:space="preserve">
<source>Filters</source>
<target state="translated">過濾器</target>
<target state="translated">高級規則</target>
</trans-unit>
<trans-unit id="NavGeneralText.Content" translate="yes" xml:space="preserve">
<source>General</source>
Expand Down
4 changes: 2 additions & 2 deletions src/EasyTidy/Strings/fr-FR/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<value>Ajouter facilement des fichiers qui doivent être filtrés pour réaliser une gestion précise de fichiers spécifiques. En ajoutant des règles de traitement de fichiers, vous pouvez personnaliser la façon dont les fichiers sont traités pour répondre aux besoins individuels. Dans le même temps, vous pouvez également utiliser la fonction de correspondance de motifs puissante des expressions régulières pour affiner davantage la logique de filtrage et de traitement des fichiers, ce qui rend la gestion des fichiers plus efficace et intelligente. Que vous souhaitiez exclure des types spécifiques de fichiers ou effectuer un traitement spécial sur des fichiers qui correspondent aux modèles spécifiques, vous pouvez facilement le faire ici.</value>
</data>
<data name="FilterSettingsControl.ModuleTitle" xml:space="preserve">
<value>Filtre</value>
<value>Avancé</value>
</data>
<data name="AtLeastOneWord" xml:space="preserve">
<value>Au moins un mot</value>
Expand Down Expand Up @@ -1089,7 +1089,7 @@
<value>Orchestration des tâches</value>
</data>
<data name="NavFiltersText.Content" xml:space="preserve">
<value>Filters</value>
<value>Règles avancées</value>
</data>
<data name="NavGeneralText.Content" xml:space="preserve">
<value>Général</value>
Expand Down
4 changes: 2 additions & 2 deletions src/EasyTidy/Strings/ja-JP/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<value>特定のファイルを正確に管理するためにフィルタリングする必要があるファイルを簡単に追加できます。ファイル処理ルールを追加することで、個人のニーズに合わせてファイルの処理方法をカスタマイズできます。また、正規表現の強力なパターンマッチング機能を使用して、ファイルのフィルタリングと処理ロジックをさらに洗練することができ、ファイル管理をより効率的かつインテリジェントにすることができます。特定のタイプのファイルを除外する場合でも、特定のパターンに一致するファイルに対して特別な処理を実行する場合でも、ここで簡単に行うことができます。</value>
</data>
<data name="FilterSettingsControl.ModuleTitle" xml:space="preserve">
<value>フィルタ</value>
<value>高級ルール</value>
</data>
<data name="AtLeastOneWord" xml:space="preserve">
<value>少なくとも1文字</value>
Expand Down Expand Up @@ -1089,7 +1089,7 @@
<value>タスクオーケストレーション</value>
</data>
<data name="NavFiltersText.Content" xml:space="preserve">
<value>フィルタ</value>
<value>高級ルール</value>
</data>
<data name="NavGeneralText.Content" xml:space="preserve">
<value>概要</value>
Expand Down
6 changes: 3 additions & 3 deletions src/EasyTidy/Strings/zh-CN/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<value>轻松地添加需要过滤的文件,实现对特定文件的精准管理。通过增加文件处理规则,你能够自定义文件的处理方式,满足个性化的需求。同时,还可以利用正则表达式强大的模式匹配功能,进一步细化文件的筛选和处理逻辑,让文件管理更加高效、智能。无论是排除特定类型的文件,还是对符合特定模式的文件进行特殊处理,都能在这里轻松实现。</value>
</data>
<data name="FilterSettingsControl.ModuleTitle" xml:space="preserve">
<value>过滤器</value>
<value>高级规则</value>
</data>
<data name="AtLeastOneWord" xml:space="preserve">
<value>至少一个单词</value>
Expand Down Expand Up @@ -1080,10 +1080,10 @@
<value>自动化</value>
</data>
<data name="NavTaskOrchestrationText.Content" xml:space="preserve">
<value>任务编排</value>
<value>整理任务</value>
</data>
<data name="NavFiltersText.Content" xml:space="preserve">
<value>过滤规则</value>
<value>高级规则</value>
</data>
<data name="NavGeneralText.Content" xml:space="preserve">
<value>常规</value>
Expand Down
2 changes: 1 addition & 1 deletion src/EasyTidy/Strings/zh-Hant/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@
<value>任務編排</value>
</data>
<data name="NavFiltersText.Content" xml:space="preserve">
<value>過濾器</value>
<value>高級規則</value>
</data>
<data name="NavGeneralText.Content" xml:space="preserve">
<value>常規</value>
Expand Down
2 changes: 1 addition & 1 deletion src/EasyTidy/Strings/zh-TW/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@
<value>任務編排</value>
</data>
<data name="NavFiltersText.Content" xml:space="preserve">
<value>過濾器</value>
<value>高級規則</value>
</data>
<data name="NavGeneralText.Content" xml:space="preserve">
<value>常規</value>
Expand Down
9 changes: 2 additions & 7 deletions src/EasyTidy/ViewModels/Automatic/AutomaticViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -917,11 +917,6 @@ private async Task<bool> IsAutomaticTableUsedByOtherTasks(int automaticTableId)
/// </summary>
private void UpdateAutomaticTable(TaskOrchestrationTable old, AutomaticTable auto, CustomConfigContentDialog dialog)
{
DateTime dateValue = DateTime.Parse(SelectTaskTime);
if (!RegularTaskRunning)
{
dateValue = ResetToZeroTime(dateValue);
}
var existingAutoTable = old.AutomaticTable;
if (existingAutoTable != null)
{
Expand All @@ -930,8 +925,8 @@ private void UpdateAutomaticTable(TaskOrchestrationTable old, AutomaticTable aut
existingAutoTable.RegularTaskRunning = CustomRegularTaskRunning;
existingAutoTable.OnScheduleExecution = CustomSchedule || !string.IsNullOrEmpty(dialog.Expression);
existingAutoTable.DelaySeconds = dialog.Delay;
existingAutoTable.Hourly = dateValue.Hour.ToString();
existingAutoTable.Minutes = dateValue.Minute.ToString();
existingAutoTable.Hourly = auto.Hourly.ToString();
existingAutoTable.Minutes = auto.Minutes.ToString();

// 更新 Schedule
if (existingAutoTable.Schedule != null && existingAutoTable.OnScheduleExecution)
Expand Down
21 changes: 21 additions & 0 deletions src/EasyTidy/Views/ContentDialogs/AddFilterContentDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,27 @@
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Button x:Name="NoticeButton"
Width="28"
Height="32"
Content="&#xE946;"
Margin="-8,0,0,0"
Padding="0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="Transparent"
BorderBrush="Transparent"
FontFamily="{ThemeResource SymbolThemeFontFamily}">
<Button.Flyout>
<Flyout>
<StackPanel>
<TextBlock Text="介于:指的是选择那些位于两个指定值之间的项(包括这两个值本身),即大于或者等于第一个值且小于或者等于第二个值" TextWrapping="Wrap"/>
<TextBlock Text="不介于:指的是选择那些不在这两个指定值之间的项,小于第一个值,或者大于第二个值" TextWrapping="Wrap"/>
<TextBlock Text="选择「介于」或者「不介于」的条件时两个值之间用英文逗号分割,最小值在前,最大值在后" TextWrapping="Wrap"/>
</StackPanel>
</Flyout>
</Button.Flyout>
</Button>
</StackPanel>
<StackPanel x:Name="CreatePropertyStackPanel"
Orientation="Horizontal"
Expand Down
3 changes: 1 addition & 2 deletions src/EasyTidy/Views/ContentDialogs/AddTaskContentDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@
x:Uid="DialogSourcePlaceholder"
Margin="6,0,0,0"
Width="210"
Text="{x:Bind ViewModel.TaskSource, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="False"/>
Text="{x:Bind ViewModel.TaskSource, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<Button x:Name="SourceButton"
x:Uid="DialogSourceButton"
Command="{x:Bind ViewModel.SelectSourcePathCommand}"/>
Expand Down
6 changes: 3 additions & 3 deletions src/EasyTidy/Views/ShellPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@
Color="Transparent"/>
</NavigationView.Resources>
<NavigationView.MenuItems>
<NavigationViewItem x:Uid="NavFiltersText"
Icon="{ui:BitmapIcon Source=/Assets/Fluent/filter.png}"
helpers:NavigationHelper.NavigateTo="EasyTidy.ViewModels.FilterViewModel"/>
<NavigationViewItem x:Uid="NavTaskOrchestrationText"
Icon="{ui:BitmapIcon Source=/Assets/Fluent/task1.png}"
helpers:NavigationHelper.NavigateTo="EasyTidy.ViewModels.TaskOrchestrationViewModel"/>
<NavigationViewItem x:Uid="NavFiltersText"
Icon="{ui:BitmapIcon Source=/Assets/Fluent/filter.png}"
helpers:NavigationHelper.NavigateTo="EasyTidy.ViewModels.FilterViewModel"/>
<NavigationViewItem x:Uid="NavAutomaticText"
Icon="{ui:BitmapIcon Source=/Assets/Fluent/behaviors.png}"
helpers:NavigationHelper.NavigateTo="EasyTidy.ViewModels.AutomaticViewModel"/>
Expand Down

0 comments on commit 7b0bf04

Please sign in to comment.