Skip to content

Commit

Permalink
Show update notification only for library packages
Browse files Browse the repository at this point in the history
  • Loading branch information
glopesdev committed Dec 17, 2024
1 parent 7302ed5 commit a187415
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
8 changes: 7 additions & 1 deletion Bonsai.NuGet/SourceRepositoryExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ public static IEnumerable<LocalPackageInfo> GetLocalPackages(this SourceReposito
return findPackageResource.GetPackages(NullLogger.Instance, token);
}

public static async Task<IEnumerable<IPackageSearchMetadata>> SearchAsync(this SourceRepository repository, string searchTerm, SearchFilter filters, int skip, int take, CancellationToken token = default)
public static async Task<IEnumerable<IPackageSearchMetadata>> SearchAsync(
this SourceRepository repository,
string searchTerm,
SearchFilter filters,
int skip = 0,
int take = int.MaxValue,
CancellationToken token = default)
{
var searchPackageResource = await repository.GetResourceAsync<PackageSearchResource>(token);
return await searchPackageResource.SearchAsync(searchTerm, filters, skip, take, NullLogger.Instance, token);
Expand Down
2 changes: 1 addition & 1 deletion Bonsai.NuGet/UpdateQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override async Task<QueryResult<IEnumerable<IPackageSearchMetadata>>> Get
try
{
var localSearchFilter = QueryHelper.CreateSearchFilter(includePrerelease: true, PackageType);
var localPackages = await LocalRepository.SearchAsync(SearchTerm, localSearchFilter, 0, int.MaxValue, token);
var localPackages = await LocalRepository.SearchAsync(SearchTerm, localSearchFilter, token: token);
return QueryResult.Create(await RemoteRepository.GetUpdatesAsync(localPackages, IncludePrerelease, token));
}
catch (NuGetProtocolException ex)
Expand Down
7 changes: 6 additions & 1 deletion Bonsai/Launcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ internal static int LaunchWorkflowEditor(
{
try
{
var localPackages = packageManager.LocalRepository.GetLocalPackages();
var localSearchFilter = QueryHelper.CreateSearchFilter(includePrerelease: true, Constants.LibraryPackageType);
var localPackages = await packageManager.LocalRepository.SearchAsync(
string.Empty,
localSearchFilter,
token: cancellation.Token);

foreach (var repository in packageManager.SourceRepositoryProvider.GetRepositories())
{
try
Expand Down

0 comments on commit a187415

Please sign in to comment.