diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs index 3acf94bf6..3ae7cfa1d 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs @@ -17,7 +17,7 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContex { private static PluginInitContext _context; - private static List _cachedBookmarks = new List(); + private static List _cachedBookmarks = new(); private static Settings _settings; @@ -107,9 +107,9 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContex } } - private static Channel _refreshQueue = Channel.CreateBounded(1); + private static readonly Channel _refreshQueue = Channel.CreateBounded(1); - private static SemaphoreSlim _fileMonitorSemaphore = new(1, 1); + private static readonly SemaphoreSlim _fileMonitorSemaphore = new(1, 1); private static async Task MonitorRefreshQueueAsync() { @@ -143,12 +143,13 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContex return; } - var watcher = new FileSystemWatcher(directory!); - watcher.Filter = Path.GetFileName(path); - - watcher.NotifyFilter = NotifyFilters.FileName | - NotifyFilters.LastWrite | - NotifyFilters.Size; + var watcher = new FileSystemWatcher(directory!) + { + Filter = Path.GetFileName(path), + NotifyFilter = NotifyFilters.FileName | + NotifyFilters.LastWrite | + NotifyFilters.Size + }; watcher.Changed += static (_, _) => { @@ -197,7 +198,7 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContex { return new List() { - new Result + new() { Title = _context.API.GetTranslation("flowlauncher_plugin_browserbookmark_copyurl_title"), SubTitle = _context.API.GetTranslation("flowlauncher_plugin_browserbookmark_copyurl_subtitle"),