mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-21 09:31:19 +02:00
Fixes #21291, allowing icons and other missing attributes to appear for NuGet packages from inside Visual Studio like they do with GitHub Nuget packages. Adds additional NuGet package information, particularly `IconURL`, to bring the Gitea NuGet API more in-line with GitHub's NuGet API. ref: https://learn.microsoft.com/en-us/nuget/api/search-query-service-resource
This commit is contained in:
@@ -37,6 +37,14 @@ type PackageVersion struct {
|
||||
DownloadCount int64 `xorm:"NOT NULL DEFAULT 0"`
|
||||
}
|
||||
|
||||
// IsPrerelease checks if the version is a prerelease version according to semantic versioning
|
||||
func (pv *PackageVersion) IsPrerelease() bool {
|
||||
if pv == nil || pv.Version == "" {
|
||||
return false
|
||||
}
|
||||
return strings.Contains(pv.Version, "-")
|
||||
}
|
||||
|
||||
// GetOrInsertVersion inserts a version. If the same version exist already ErrDuplicatePackageVersion is returned
|
||||
func GetOrInsertVersion(ctx context.Context, pv *PackageVersion) (*PackageVersion, error) {
|
||||
e := db.GetEngine(ctx)
|
||||
|
Reference in New Issue
Block a user