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
Cut a clip: settings schema 45
KnifeLemon4f86d2fbdac4
diff --git a/src/Filee.Core/Presets/BuiltInData.cs b/src/Filee.Core/Presets/BuiltInData.csindex 003101cc..192f5966 100644--- a/src/Filee.Core/Presets/BuiltInData.cs+++ b/src/Filee.Core/Presets/BuiltInData.cs@@ -121,7 +121,7 @@ public static class BuiltInData];/// <summary>- /// "Cut a clip" (added in settings schema 44): a part of a video, chosen on a timeline, as a file of its own. First on+ /// "Cut a clip" (added in settings schema 45): a part of a video, chosen on a timeline, as a file of its own. First on/// the back of the video donut, as "Crop" is on the images donut./// </summary>public static List<Preset> ClipPresets() =>diff --git a/src/Filee.Core/Settings/AppSettings.cs b/src/Filee.Core/Settings/AppSettings.csindex f9baf498..b503eda3 100644--- a/src/Filee.Core/Settings/AppSettings.cs+++ b/src/Filee.Core/Settings/AppSettings.cs@@ -123,7 +123,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 = 44;+ public const int CurrentSchemaVersion = 45;public int SchemaVersion { get; set; } = CurrentSchemaVersion;diff --git a/src/Filee.Core/Settings/UserDataStore.cs b/src/Filee.Core/Settings/UserDataStore.csindex f73093a7..29b0b8ae 100644--- a/src/Filee.Core/Settings/UserDataStore.cs+++ b/src/Filee.Core/Settings/UserDataStore.cs@@ -840,12 +840,12 @@ internal static class SettingsMigrations// renumbered if another change takes it first.)if (from < 43)changed |= LearnExtensions(profiles, out _, ["fits", "fts"]);- // v44: "Cut a clip" (a part of a video as a file of its own), after "Motion Photo (Android)" as in a new library,+ // v45: "Cut a clip" (a part of a video as a file of its own), after "Motion Photo (Android)" as in a new library,// and first on the back of the video donut in place of FLAC (which stays in the library), when the user// hasn't put it elsewhere on the donut and the face has room.- // Present already but saved since by a Filee before 44: that one dropped the tool's name, which made it a+ // Present already but saved since by a Filee before 45: that one dropped the tool's name, which made it a// crop, so it is put back. The user's own changes (name, file name pattern) stay.- if (from < 44)+ if (from < 45)changed |= AddClipTool(presets, profiles);return changed;}diff --git a/tests/Filee.Core.Tests/ClipToolTests.cs b/tests/Filee.Core.Tests/ClipToolTests.csindex bb998eea..6febc61c 100644--- a/tests/Filee.Core.Tests/ClipToolTests.cs+++ b/tests/Filee.Core.Tests/ClipToolTests.cs@@ -1,5 +1,5 @@// "Cut a clip": the range kept inside the video, the times as shown and as FFmpeg reads them, the conversion the tool-// becomes, and the preset arriving in libraries from before it (settings schema 44).+// becomes, and the preset arriving in libraries from before it (settings schema 45).using System.Globalization;using System.Text.Json;@@ -192,7 +192,7 @@ public class ClipToolTestsAssert.DoesNotContain("\"tool\"", JsonSerializer.Serialize(new List<Preset> { new() { TargetFormat = "png" } }, FileeJsonContext.Default.ListPreset));}- // ───────────────────────── Settings schema 44 ─────────────────────────+ // ───────────────────────── Settings schema 45 ─────────────────────────[Fact]public void A_new_library_has_the_clip_tool_first_behind_the_video_donut()@@ -209,22 +209,22 @@ public class ClipToolTests}[Fact]- public void Version_43_libraries_get_the_clip_tool_and_it_goes_behind_the_video_donut()+ public void Version_44_libraries_get_the_clip_tool_and_it_goes_behind_the_video_donut(){var presets = BuiltInData.CreatePresets();presets.RemoveAll(p => p.Id == "tool-clip");var profiles = BuiltInData.CreateProfiles();var video = profiles.Single(p => p.Id == "video");- // The back face of 43: FLAC after WAV, no clip tool.+ // The back face of 44: FLAC after WAV, no clip tool.video.BackPresetIds!.Remove("tool-clip");video.BackPresetIds.Insert(video.BackPresetIds.IndexOf("to-wav") + 1, "to-flac");- Assert.True(SettingsMigrations.ApplyToLibrary(43, presets, profiles));+ Assert.True(SettingsMigrations.ApplyToLibrary(44, presets, profiles));Assert.Equal(BuiltInData.CreatePresets().Select(p => p.Id), presets.Select(p => p.Id));Assert.True(presets.Single(p => p.Id == "tool-clip").IsClipTool);Assert.Equal(BuiltInData.CreateProfiles().Single(p => p.Id == "video").BackPresetIds, video.BackPresetIds);- Assert.False(SettingsMigrations.ApplyToLibrary(43, presets, profiles)); // once only+ Assert.False(SettingsMigrations.ApplyToLibrary(44, presets, profiles)); // once only// A full back face makes room by giving up FLAC; one the user filled up without FLAC, or with the tool on the// front, stays as it is.@@ -234,7 +234,7 @@ public class ClipToolTestswithFlacBack.Add("to-flac");while (withFlacBack.Count < ToolbarProfile.MaxSlices)withFlacBack.Add("to-mp3");- SettingsMigrations.ApplyToLibrary(43, BuiltInData.CreatePresets(), withFlac);+ SettingsMigrations.ApplyToLibrary(44, BuiltInData.CreatePresets(), withFlac);Assert.Equal("tool-clip", withFlacBack[0]);Assert.DoesNotContain("to-flac", withFlacBack);Assert.Equal(ToolbarProfile.MaxSlices, withFlacBack.Count);@@ -245,21 +245,21 @@ public class ClipToolTestswhile (fullBack.Count < ToolbarProfile.MaxSlices)fullBack.Add("to-mp3");var before = fullBack.ToList();- SettingsMigrations.ApplyToLibrary(43, BuiltInData.CreatePresets(), full);+ SettingsMigrations.ApplyToLibrary(44, BuiltInData.CreatePresets(), full);Assert.Equal(before, fullBack);var front = BuiltInData.CreateProfiles();var frontVideo = front.Single(p => p.Id == "video");frontVideo.BackPresetIds!.Remove("tool-clip");frontVideo.PresetIds[^1] = "tool-clip";- SettingsMigrations.ApplyToLibrary(43, BuiltInData.CreatePresets(), front);+ SettingsMigrations.ApplyToLibrary(44, BuiltInData.CreatePresets(), front);Assert.DoesNotContain("tool-clip", frontVideo.BackPresetIds);}[Fact]public void Back_from_an_older_Filee_the_clip_tool_cuts_clips_again_and_keeps_the_users_changes(){- // A Filee from 26 to 43 reads the unknown "tool" as nothing (a crop) and saves it so.+ // A Filee from 26 to 44 reads the unknown "tool" as nothing (a crop) and saves it so.var presets = BuiltInData.CreatePresets();var clip = presets.Single(p => p.Id == "tool-clip");clip.Tool = null;@@ -267,7 +267,7 @@ public class ClipToolTestsclip.Output.FileNamePattern = "{name}_best";Assert.True(clip.IsCropTool);- Assert.True(SettingsMigrations.ApplyToLibrary(43, presets, BuiltInData.CreateProfiles()));+ Assert.True(SettingsMigrations.ApplyToLibrary(44, presets, BuiltInData.CreateProfiles()));Assert.True(clip.IsClipTool);Assert.Equal(("Highlights", "{name}_best"), (clip.Name, clip.Output.FileNamePattern));@@ -276,7 +276,7 @@ public class ClipToolTests// A Filee before 26 read it as a group.clip.Kind = PresetKind.Group;clip.TargetFormat = Preset.GroupTarget;- Assert.True(SettingsMigrations.ApplyToLibrary(43, presets, BuiltInData.CreateProfiles()));+ Assert.True(SettingsMigrations.ApplyToLibrary(44, presets, BuiltInData.CreateProfiles()));Assert.True(clip.IsClipTool);Assert.Equal(BuiltInData.SameAsSource, clip.TargetFormat);}diff --git a/tests/Filee.Core.Tests/MediaToolTests.cs b/tests/Filee.Core.Tests/MediaToolTests.csindex 7b1f4dbc..04a24f89 100644--- a/tests/Filee.Core.Tests/MediaToolTests.cs+++ b/tests/Filee.Core.Tests/MediaToolTests.cs@@ -145,7 +145,7 @@ public class MediaToolTestsAssert.True(SettingsMigrations.ApplyToLibrary(36, presets, profiles));- // "Cut a clip" (schema 44) comes in first as well.+ // "Cut a clip" (schema 45) comes in first as well.Assert.Equal(["tool-clip", "mp4-av1", "to-wav", "compress-video", "merge-videos", "extract-audio", "zip-all"], video.BackPresetIds);}