From 2eda014f27aec854f950716619364b56b1e4fce8 Mon Sep 17 00:00:00 2001 From: routersys Date: Sun, 13 Sep 2026 11:26:30 +0900 Subject: [PATCH] =?UTF-8?q?=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=81=BF=E9=A0=86?= =?UTF-8?q?=E3=81=AE=E7=A2=BA=E8=AA=8D=E3=81=A8=E5=85=88=E9=A0=AD=E3=81=B8?= =?UTF-8?q?=E3=81=AE=E7=A7=BB=E5=8B=95=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProxyForge/PluginOrder.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ProxyForge/PluginOrder.cs diff --git a/ProxyForge/PluginOrder.cs b/ProxyForge/PluginOrder.cs new file mode 100644 index 0000000..5369d45 --- /dev/null +++ b/ProxyForge/PluginOrder.cs @@ -0,0 +1,21 @@ +using System.Collections.Immutable; +using YukkuriMovieMaker.Plugin; + +namespace ProxyForge; + +internal static class PluginOrder +{ + public static string PluginName { get; } = typeof(ProxyForgeVideoFileSourcePlugin).FullName ?? nameof(ProxyForgeVideoFileSourcePlugin); + + public static bool IsFirst(ImmutableList order, string name) + => order.Count > 0 && string.Equals(order[0], name, StringComparison.Ordinal); + + public static ImmutableList MoveToFront(ImmutableList order, string name) + => order.RemoveAll(entry => string.Equals(entry, name, StringComparison.Ordinal)).Insert(0, name); + + public static bool IsPluginFirst() + => IsFirst(PluginLoaderSettings.Default.VideoFileSourcePlugins, PluginName); + + public static void MovePluginToFront() + => PluginLoaderSettings.Default.VideoFileSourcePlugins = MoveToFront(PluginLoaderSettings.Default.VideoFileSourcePlugins, PluginName); +}