Skip to content

armgit / Filee

Public Imported from GitHub
0

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.

Merge main and move the .dav migration to schema 50 after the text extensions (#663)

KnifeLemonaa793750a019
diff --cc src/Filee.Core/Settings/AppSettings.cs
index b5f953c4,b5f953c4..10736b21
--- a/src/Filee.Core/Settings/AppSettings.cs
+++ b/src/Filee.Core/Settings/AppSettings.cs
@@@ -123,7 -123,7 +123,7 @@@ public sealed class DonutSetting
public sealed class AppSettings
{
/// <summary>Current schema version. Increase when the format changes and add a migration.</summary>
-- public const int CurrentSchemaVersion = 49;
++ public const int CurrentSchemaVersion = 50;
public int SchemaVersion { get; set; } = CurrentSchemaVersion;
diff --cc src/Filee.Core/Settings/UserDataStore.cs
index 88ff480f,d4ae8582..76eeee2f
--- a/src/Filee.Core/Settings/UserDataStore.cs
+++ b/src/Filee.Core/Settings/UserDataStore.cs
@@@ -889,10 -889,10 +889,13 @@@ internal static class SettingsMigration
// v48: fragmented MP4 pieces (.m4s) learn the video donut; custom claims stay put.
if (from < 48)
changed |= LearnExtensions(profiles, out _, ["m4s"]);
- // v49: Dahua DVR recordings (.dav) learn the video donut; custom claims stay put. (Schema 49 may be renumbered
- // if another change takes it first.)
+ // v49: SQL (#607, which came without a migration), AutoHotkey, INI, RouterOS exports and .cmd batch scripts learn
- // the text donut; custom claims stay put. (Schema 49 may be renumbered if another change takes it first.)
++ // the text donut; custom claims stay put.
if (from < 49)
+ changed |= LearnExtensions(profiles, out _, ["sql", "ahk", "ini", "rsc", "cmd"]);
++ // v50: Dahua DVR recordings (.dav) learn the video donut; custom claims stay put.
++ if (from < 50)
+ changed |= LearnExtensions(profiles, out _, ["dav"]);
return changed;
}
diff --cc tests/Filee.Core.Tests/DavFormatTests.cs
index 6f7007d5,00000000..f7d91446
mode 100644,000000..100644
--- a/tests/Filee.Core.Tests/DavFormatTests.cs
+++ b/tests/Filee.Core.Tests/DavFormatTests.cs
@@@ -1,34 -1,0 +1,34 @@@
+// Dahua DVR recordings (.dav, #594): a read-only video source on the video donut, learned by existing libraries.
+
+using Filee.Core.Formats;
+using Filee.Core.Presets;
+using Filee.Core.Profiles;
+using Filee.Core.Settings;
+
+namespace Filee.Core.Tests;
+
+public class DavFormatTests
+{
+ [Fact]
+ public void Dav_is_a_video_filee_reads_but_never_writes()
+ {
+ var dav = FormatRegistry.Detect("ch10_main_20261005150000.DAV");
+ Assert.NotNull(dav);
+ Assert.Equal(("dav", FormatCategory.Video, false), (dav.Id, dav.Category, dav.Writable));
+ Assert.Equal("video", ProfileSelector.Select(BuiltInData.CreateProfiles(), ["camera.dav"])?.Id);
+ }
+
+ [Fact]
- public void Version_48_libraries_learn_dav_once()
++ public void Version_49_libraries_learn_dav_once()
+ {
+ var presets = BuiltInData.CreatePresets();
+ var profiles = BuiltInData.CreateProfiles();
+ var video = profiles.Single(p => p.Id == "video");
+ video.Extensions.Remove("dav");
+
- Assert.True(SettingsMigrations.ApplyToLibrary(48, presets, profiles));
++ Assert.True(SettingsMigrations.ApplyToLibrary(49, presets, profiles));
+
+ Assert.Contains("dav", video.Extensions);
- Assert.False(SettingsMigrations.ApplyToLibrary(48, presets, profiles));
++ Assert.False(SettingsMigrations.ApplyToLibrary(49, presets, profiles));
+ }
+}