mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-26 06:37:07 +00:00
fix(metadata): treat .mod and .info names as metadata for Go only
GetStats, the package list and the stats snapshots dropped any registry's names that end in .mod or .info. An npm or PyPI package with such a name vanished from the counts. The filter now matches IsMetadataEntry.
This commit is contained in:
@@ -50,8 +50,9 @@ func (s *GORMStoreV2) registryNames() map[int32]string {
|
||||
// groupFilter builds the WHERE clause shared by the group count, the group page and the row fetch.
|
||||
func (s *GORMStoreV2) groupFilter(opts metadata.GroupListOptions) (clause string, args []interface{}, empty bool, err error) {
|
||||
// The artifact filter GetStats applies, so list totals and /api/stats agree.
|
||||
clause = "version NOT IN ? AND name NOT LIKE ? AND name NOT LIKE ?"
|
||||
args = []interface{}{metadata.MetadataVersions, "%.mod", "%.info"}
|
||||
nameCond, nameArgs := notGoMetadataName()
|
||||
clause = "version NOT IN ? AND " + nameCond
|
||||
args = append([]interface{}{metadata.MetadataVersions}, nameArgs...)
|
||||
if opts.Registry != "" {
|
||||
id, idErr := s.getRegistryID(opts.Registry)
|
||||
if idErr != nil {
|
||||
|
||||
Reference in New Issue
Block a user