@@ -186,16 +186,6 @@ internal async ValueTask<List<Result>> RequestUpdate(string search, Cancellation
186
186
{
187
187
await UpdateManifestAsync ( token ) ;
188
188
189
- var autocompletedResults = AutoCompleteReturnAllResults ( search ,
190
- Settings . HotkeyUpdate ,
191
- "Update" ,
192
- "Select a plugin to update" ) ;
193
-
194
- if ( autocompletedResults . Any ( ) )
195
- return autocompletedResults ;
196
-
197
- var uninstallSearch = search . Replace ( Settings . HotkeyUpdate , string . Empty , StringComparison . OrdinalIgnoreCase ) . TrimStart ( ) ;
198
-
199
189
var resultsForUpdate =
200
190
from existingPlugin in Context . API . GetAllPlugins ( )
201
191
join pluginFromManifest in PluginsManifest . UserPlugins
@@ -283,7 +273,7 @@ await Http.DownloadAsync(x.PluginNewUserPlugin.UrlDownload, downloadToFilePath)
283
273
}
284
274
} ) ;
285
275
286
- return Search ( results , uninstallSearch ) ;
276
+ return Search ( results , search ) ;
287
277
}
288
278
289
279
internal bool PluginExists ( string id )
@@ -367,15 +357,13 @@ private bool InstallSourceKnown(string url)
367
357
return url . StartsWith ( acceptedSource ) && Context . API . GetAllPlugins ( ) . Any ( x => x . Metadata . Website . StartsWith ( contructedUrlPart ) ) ;
368
358
}
369
359
370
- internal async ValueTask < List < Result > > RequestInstallOrUpdate ( string searchName , CancellationToken token )
360
+ internal async ValueTask < List < Result > > RequestInstallOrUpdate ( string search , CancellationToken token )
371
361
{
372
362
await UpdateManifestAsync ( token ) ;
373
363
374
- var searchNameWithoutKeyword = searchName . Replace ( Settings . HotKeyInstall , string . Empty , StringComparison . OrdinalIgnoreCase ) . Trim ( ) ;
375
-
376
- if ( Uri . IsWellFormedUriString ( searchNameWithoutKeyword , UriKind . Absolute )
377
- && searchNameWithoutKeyword . Split ( '.' ) . Last ( ) == zip )
378
- return InstallFromWeb ( searchNameWithoutKeyword ) ;
364
+ if ( Uri . IsWellFormedUriString ( search , UriKind . Absolute )
365
+ && search . Split ( '.' ) . Last ( ) == zip )
366
+ return InstallFromWeb ( search ) ;
379
367
380
368
var results =
381
369
PluginsManifest
@@ -401,7 +389,7 @@ internal async ValueTask<List<Result>> RequestInstallOrUpdate(string searchName,
401
389
ContextData = x
402
390
} ) ;
403
391
404
- return Search ( results , searchNameWithoutKeyword ) ;
392
+ return Search ( results , search ) ;
405
393
}
406
394
407
395
private void Install ( UserPlugin plugin , string downloadedFilePath )
@@ -461,16 +449,6 @@ private void Install(UserPlugin plugin, string downloadedFilePath)
461
449
462
450
internal List < Result > RequestUninstall ( string search )
463
451
{
464
- var autocompletedResults = AutoCompleteReturnAllResults ( search ,
465
- Settings . HotkeyUninstall ,
466
- "Uninstall" ,
467
- "Select a plugin to uninstall" ) ;
468
-
469
- if ( autocompletedResults . Any ( ) )
470
- return autocompletedResults ;
471
-
472
- var uninstallSearch = search . Replace ( Settings . HotkeyUninstall , string . Empty , StringComparison . OrdinalIgnoreCase ) . TrimStart ( ) ;
473
-
474
452
var results = Context . API
475
453
. GetAllPlugins ( )
476
454
. Select ( x =>
@@ -501,7 +479,7 @@ internal List<Result> RequestUninstall(string search)
501
479
}
502
480
} ) ;
503
481
504
- return Search ( results , uninstallSearch ) ;
482
+ return Search ( results , search ) ;
505
483
}
506
484
507
485
private void Uninstall ( PluginMetadata plugin , bool removedSetting = true )
@@ -516,36 +494,6 @@ private void Uninstall(PluginMetadata plugin, bool removedSetting = true)
516
494
using var _ = File . CreateText ( Path . Combine ( plugin . PluginDirectory , "NeedDelete.txt" ) ) ;
517
495
}
518
496
519
- private List < Result > AutoCompleteReturnAllResults ( string search , string hotkey , string title , string subtitle )
520
- {
521
- if ( ! string . IsNullOrEmpty ( search )
522
- && hotkey . StartsWith ( search )
523
- && ( hotkey != search || ! search . StartsWith ( hotkey ) ) )
524
- {
525
- return
526
- new List < Result >
527
- {
528
- new Result
529
- {
530
- Title = title ,
531
- IcoPath = icoPath ,
532
- SubTitle = subtitle ,
533
- Action = e =>
534
- {
535
- Context
536
- . API
537
- . ChangeQuery (
538
- $ "{ Context . CurrentPluginMetadata . ActionKeywords . FirstOrDefault ( ) } { hotkey } ") ;
539
-
540
- return false ;
541
- }
542
- }
543
- } ;
544
- }
545
-
546
- return new List < Result > ( ) ;
547
- }
548
-
549
497
private bool SameOrLesserPluginVersionExists ( string metadataPath )
550
498
{
551
499
var newMetadata = JsonSerializer . Deserialize < PluginMetadata > ( File . ReadAllText ( metadataPath ) ) ;
0 commit comments