@@ -54,7 +54,7 @@ public static class PluginManager
5454 /// </summary>
5555 public static void Save ( )
5656 {
57- foreach ( var pluginPair in GetAllInitializedPlugins ( false ) )
57+ foreach ( var pluginPair in GetAllInitializedPlugins ( includeFailed : false ) )
5858 {
5959 var savable = pluginPair . Plugin as ISavable ;
6060 try
@@ -74,7 +74,7 @@ public static void Save()
7474 public static async ValueTask DisposePluginsAsync ( )
7575 {
7676 // Still call dispose for all plugins even if initialization failed, so that we can clean up resources
77- foreach ( var pluginPair in GetAllInitializedPlugins ( true ) )
77+ foreach ( var pluginPair in GetAllInitializedPlugins ( includeFailed : true ) )
7878 {
7979 await DisposePluginAsync ( pluginPair ) ;
8080 }
@@ -102,7 +102,7 @@ private static async Task DisposePluginAsync(PluginPair pluginPair)
102102
103103 public static async Task ReloadDataAsync ( )
104104 {
105- await Task . WhenAll ( [ .. GetAllInitializedPlugins ( false ) . Select ( plugin => plugin . Plugin switch
105+ await Task . WhenAll ( [ .. GetAllInitializedPlugins ( includeFailed : false ) . Select ( plugin => plugin . Plugin switch
106106 {
107107 IReloadable p => Task . Run ( p . ReloadData ) ,
108108 IAsyncReloadable p => p . ReloadDataAsync ( ) ,
@@ -116,7 +116,7 @@ public static async Task ReloadDataAsync()
116116
117117 public static async Task OpenExternalPreviewAsync ( string path , bool sendFailToast = true )
118118 {
119- await Task . WhenAll ( [ .. GetAllInitializedPlugins ( false ) . Select ( plugin => plugin . Plugin switch
119+ await Task . WhenAll ( [ .. GetAllInitializedPlugins ( includeFailed : false ) . Select ( plugin => plugin . Plugin switch
120120 {
121121 IAsyncExternalPreview p => p . OpenPreviewAsync ( path , sendFailToast ) ,
122122 _ => Task . CompletedTask ,
@@ -125,7 +125,7 @@ public static async Task OpenExternalPreviewAsync(string path, bool sendFailToas
125125
126126 public static async Task CloseExternalPreviewAsync ( )
127127 {
128- await Task . WhenAll ( [ .. GetAllInitializedPlugins ( false ) . Select ( plugin => plugin . Plugin switch
128+ await Task . WhenAll ( [ .. GetAllInitializedPlugins ( includeFailed : false ) . Select ( plugin => plugin . Plugin switch
129129 {
130130 IAsyncExternalPreview p => p . ClosePreviewAsync ( ) ,
131131 _ => Task . CompletedTask ,
@@ -134,7 +134,7 @@ public static async Task CloseExternalPreviewAsync()
134134
135135 public static async Task SwitchExternalPreviewAsync ( string path , bool sendFailToast = true )
136136 {
137- await Task . WhenAll ( [ .. GetAllInitializedPlugins ( false ) . Select ( plugin => plugin . Plugin switch
137+ await Task . WhenAll ( [ .. GetAllInitializedPlugins ( includeFailed : false ) . Select ( plugin => plugin . Plugin switch
138138 {
139139 IAsyncExternalPreview p => p . SwitchPreviewAsync ( path , sendFailToast ) ,
140140 _ => Task . CompletedTask ,
@@ -824,7 +824,7 @@ private static bool SameOrLesserPluginVersionExists(string metadataPath)
824824 return true ; // If version is not valid, we assume it is lesser than any existing version
825825
826826 // Get all plugins even if initialization failed so that we can check if the plugin with the same ID exists
827- return GetAllInitializedPlugins ( true ) . Any ( x => x . Metadata . ID == newMetadata . ID
827+ return GetAllInitializedPlugins ( includeFailed : true ) . Any ( x => x . Metadata . ID == newMetadata . ID
828828 && Version . TryParse ( x . Metadata . Version , out var version )
829829 && newVersion <= version ) ;
830830 }
@@ -966,7 +966,7 @@ internal static async Task<bool> UninstallPluginAsync(PluginMetadata plugin, boo
966966 // If we want to remove plugin from AllPlugins,
967967 // we need to dispose them so that they can release file handles
968968 // which can help FL to delete the plugin settings & cache folders successfully
969- var pluginPairs = GetAllInitializedPlugins ( true ) . Where ( p => p . Metadata . ID == plugin . ID ) . ToList ( ) ;
969+ var pluginPairs = GetAllInitializedPlugins ( includeFailed : true ) . Where ( p => p . Metadata . ID == plugin . ID ) . ToList ( ) ;
970970 foreach ( var pluginPair in pluginPairs )
971971 {
972972 await DisposePluginAsync ( pluginPair ) ;
0 commit comments