Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.
C# audio-converteravaloniabatch-conversionconvertercsharpdocument-converterdocx-to-pdfdotnetdrag-and-dropfile-conversionfile-converterheic-converterhwphwpximage-converterlinuxmacospdf-convertervideo-converterwindows
Offer ZIP archive on donut for multiple files or folders and add to archives profile
gtxPrimecac113b727ce
diff --git a/src/Filee.App/Services/DraggedFiles.cs b/src/Filee.App/Services/DraggedFiles.csindex e5fca059..98b369a9 100644--- a/src/Filee.App/Services/DraggedFiles.cs+++ b/src/Filee.App/Services/DraggedFiles.cs@@ -16,11 +16,11 @@ internal static class DraggedFilesdata.Contains(DataFormat.File) || data.Items.Any(item => item.Formats.Any(IsFilenames));/// <summary>- /// Local file paths in the drag (folders and virtual items are ignored). A shortcut counts as the file it points- /// to; one to a folder is ignored like the folder.+ /// Local file and folder paths in the drag (virtual items are ignored). A shortcut counts as the item it points+ /// to; one to a folder counts as the folder./// </summary>public static IReadOnlyList<string> Local(IDataTransfer data) =>- Local(data, File.Exists, AppHost.Get<IPlatformServices>().ResolveShortcuts);+ Local(data, ConversionService.Exists, AppHost.Get<IPlatformServices>().ResolveShortcuts);internal static IReadOnlyList<string> Local(IDataTransfer data, Func<string, bool> fileExists,Func<IReadOnlyList<string>, IReadOnlyList<string>>? resolveShortcuts = null)diff --git a/src/Filee.App/ViewModels/RadialViewModel.cs b/src/Filee.App/ViewModels/RadialViewModel.csindex 37f25c5b..2a9d8c95 100644--- a/src/Filee.App/ViewModels/RadialViewModel.cs+++ b/src/Filee.App/ViewModels/RadialViewModel.cs@@ -107,6 +107,14 @@ public sealed partial class RadialViewModel(UserDataStore store, ILocalizer loc,.OfType<Preset>().ToList();+ if ((files.Count > 1 || files.Any(Directory.Exists))+ && Presets.All(p => !p.Archive.CombineIntoOne || p.TargetFormat != "zip")+ && store.FindPreset("zip-all") is { } zipAll+ && Presets.Count < ToolbarProfile.MaxSlices)+ {+ Presets.Add(zipAll);+ }+_subPresets = Presets.Select(p => (IReadOnlyList<Preset>)(p.IsGroup ? p.SubPresetIds : []).Select(store.FindPreset).OfType<Preset>().Where(c => !c.IsGroup).Take(Preset.MaxSubPresets).ToList())diff --git a/src/Filee.Core/Presets/BuiltInData.cs b/src/Filee.Core/Presets/BuiltInData.csindex 1ad105a2..f46eb5f2 100644--- a/src/Filee.Core/Presets/BuiltInData.cs+++ b/src/Filee.Core/Presets/BuiltInData.cs@@ -420,7 +420,7 @@ public static class BuiltInData{Id = "archives", NameKey = "profile.archives",Extensions = ExtensionsOf(FormatCategory.Archive),- PresetIds = ["extract", "to-zip", "to-7z", "to-tgz", "to-tar"],+ PresetIds = ["extract", "zip-all", "to-zip", "to-7z", "to-tgz", "to-tar"],},new(){diff --git a/src/Filee.Core/Settings/AppSettings.cs b/src/Filee.Core/Settings/AppSettings.csindex 313d90fb..c88c2eab 100644--- a/src/Filee.Core/Settings/AppSettings.cs+++ b/src/Filee.Core/Settings/AppSettings.cs@@ -64,7 +64,7 @@ public sealed class DonutSettingspublic sealed class AppSettings{/// <summary>Current schema version. Increase when the format changes and add a migration.</summary>- public const int CurrentSchemaVersion = 22;+ public const int CurrentSchemaVersion = 23;public int SchemaVersion { get; set; } = CurrentSchemaVersion;diff --git a/src/Filee.Core/Settings/UserDataStore.cs b/src/Filee.Core/Settings/UserDataStore.csindex a7975248..8cb09761 100644--- a/src/Filee.Core/Settings/UserDataStore.cs+++ b/src/Filee.Core/Settings/UserDataStore.cs@@ -563,6 +563,9 @@ internal static class SettingsMigrations// takes it. Other extensions the user removed from a built-in donut stay removed.if (from < 22)changed |= LearnExtensions(profiles, out _, ["fbx"]);+ // v23: "Combine into one ZIP" on the archives donut after "extract".+ if (from < 23)+ changed |= Offer(presets, profiles, "archives", "zip-all", "extract");return changed;}diff --git a/tests/Filee.App.Tests/DonutGroupTests.cs b/tests/Filee.App.Tests/DonutGroupTests.csindex a9591bdc..87028e16 100644--- a/tests/Filee.App.Tests/DonutGroupTests.cs+++ b/tests/Filee.App.Tests/DonutGroupTests.cs@@ -672,4 +672,19 @@ public class DonutGroupTestsvar position = RadialController.WindowPosition(new PixelPoint(960, 540), new PixelRect(0, 0, 1920, 1080), side);Assert.Equal(new PixelPoint(960 - side / 2, 540 - side / 2), position);}++ [AvaloniaFact]+ public void Multiple_files_or_folders_dynamically_include_zip_all_preset_on_the_donut()+ {+ TestServices.EnsureInitialized("en");+ var vm = AppHost.Get<RadialViewModel>();+ // Single file: uses images profile without zip-all+ vm.Load([@"C:\photos\a.jpg"], clickMode: true);+ Assert.DoesNotContain(vm.Items, item => item.Id == "zip-all");++ // Multiple files: dynamically includes zip-all+ vm.Load([@"C:\photos\a.jpg", @"C:\photos\b.jpg"], clickMode: true);+ Assert.Contains(vm.Items, item => item.Id == "zip-all");+ }}+diff --git a/tests/Filee.Core.Tests/UserDataStoreTests.cs b/tests/Filee.Core.Tests/UserDataStoreTests.csindex 42c55c56..eb33bc34 100644--- a/tests/Filee.Core.Tests/UserDataStoreTests.cs+++ b/tests/Filee.Core.Tests/UserDataStoreTests.cs@@ -577,6 +577,22 @@ public class UserDataStoreTestsAssert.DoesNotContain("fbx", profiles.Single(p => p.Id == "models").Extensions);}+ [Fact]+ public void Version_22_libraries_get_zip_all_on_the_archives_donut_after_extract()+ {+ var presets = BuiltInData.CreatePresets();+ var profiles = BuiltInData.CreateProfiles();+ var archives = profiles.Single(p => p.Id == "archives");+ archives.PresetIds.Remove("zip-all");++ Assert.True(SettingsMigrations.ApplyToLibrary(22, presets, profiles));+ Assert.Contains("zip-all", archives.PresetIds);+ var extractIndex = archives.PresetIds.IndexOf("extract");+ var zipAllIndex = archives.PresetIds.IndexOf("zip-all");+ Assert.Equal(extractIndex + 1, zipAllIndex);+ Assert.False(SettingsMigrations.ApplyToLibrary(23, presets, profiles)); // once only+ }+[Fact]public void Version_15_libraries_get_the_tracing_presets_on_the_images_donut_after_pdf(){