Skip to content

Commit 5919418

Browse files
committed
Add assembly name & plugin settings path & plugin cache path in meta data for csharp plugins
1 parent 89bca3b commit 5919418

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

Flow.Launcher.Core/Plugin/PluginsLoader.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.IO;
34
using System.Linq;
45
using System.Reflection;
56
using System.Threading.Tasks;
@@ -73,6 +74,11 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
7374
typeof(IAsyncPlugin));
7475

7576
plugin = Activator.CreateInstance(type) as IAsyncPlugin;
77+
78+
var assemblyName = assembly.GetName().Name;
79+
metadata.AssemblyName = assemblyName;
80+
metadata.PluginSettingsDirectoryPath = Path.Combine(DataLocation.PluginSettingsDirectory, assemblyName);
81+
metadata.PluginCacheDirectoryPath = Path.Combine(DataLocation.PluginCacheDirectory, assemblyName);
7682
}
7783
#if DEBUG
7884
catch (Exception e)

Flow.Launcher.Plugin/PluginMetadata.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ public class PluginMetadata : BaseModel
1616
public string Website { get; set; }
1717
public bool Disabled { get; set; }
1818
public string ExecuteFilePath { get; private set;}
19-
2019
public string ExecuteFileName { get; set; }
2120

21+
[JsonIgnore]
22+
public string AssemblyName { get; internal set; }
23+
2224
public string PluginDirectory
2325
{
24-
get { return _pluginDirectory; }
26+
get => _pluginDirectory;
2527
internal set
2628
{
2729
_pluginDirectory = value;
@@ -49,9 +51,17 @@ public override string ToString()
4951
/// </summary>
5052
[JsonIgnore]
5153
public long InitTime { get; set; }
54+
5255
[JsonIgnore]
5356
public long AvgQueryTime { get; set; }
57+
5458
[JsonIgnore]
5559
public int QueryCount { get; set; }
60+
61+
[JsonIgnore]
62+
public string PluginSettingsDirectoryPath { get; internal set; }
63+
64+
[JsonIgnore]
65+
public string PluginCacheDirectoryPath { get; internal set; }
5666
}
5767
}

0 commit comments

Comments
 (0)