Skip to content

Conversation

@JoC0de
Copy link
Collaborator

@JoC0de JoC0de commented Nov 2, 2023

  • allow fetching updates using registrationsBaseUrl
  • getting single NuGet packages using registrationsBaseUrl
  • add the new settings to Settings-UI

fixes #598
and fixes #589

…ates and getting single NuGet packages using registrationsBaseUrl
@JoC0de JoC0de self-assigned this Nov 2, 2023
@JoC0de JoC0de requested a review from igor84 November 2, 2023 23:02
searchQueryBuilder.Append(' ');
}

searchQueryBuilder.Append($"packageid:{packagesToFetch[i].Id}");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are using string interpolation here then perhaps a cleaner solution instead of StringBuilder is to just build a List and then use string.Join(" ", list).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would need:

var query = string.Join(' ', packagesToFetch.Skip(i).Take(UpdateSearchBatchSize).Select(package => $"{package.Id}_"));
i += UpdateSearchBatchSize;

As there is no Chunk method in older C# we need the index. Not sure if the Unity implementation of the Skip already has optimization for List. Do you think it would make the code more readable, with the Skip / Take?

Another think is we could use AppendFormat as none .Net Core doesn't has the Append overload that takes a AppendInterpolatedStringHandler.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just thought to replace StringBuilder with List and ToString with string.join leaving everything else the same.

@JoC0de JoC0de merged commit 65f9602 into GlitchEnzo:master Nov 12, 2023
@JoC0de JoC0de deleted the feature/github-packages-support branch November 12, 2023 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package fails to download from GitHub Enterprise Server. The NuGet Explorer does not load NuGet packages from an Azure Artifacts feed.

2 participants