WIP: Adding Stars as a vanity stats option #931

open
opened by cuducos.me targeting master from cuducos.me/core.tangled.org: stars-vanity

Opening it as draft because I am a noob on Nix and couldn't test it locally yet. But opening a PR to share progress, and open room for advice one what might be better : )

Changed files
+8 -1
appview
lexicons
actor
+3
appview/db/profile.go
··· 420 420 case models.VanityStatRepositoryCount: 421 421 query = `select count(id) from repos where did = ?` 422 422 args = append(args, did) 423 + case models.VanityStatStarCount: 424 + query = `select count(id) from stars where did = ?` 425 + args = append(args, did) 423 426 } 424 427 425 428 var result uint64
+3
appview/models/profile.go
··· 58 58 VanityStatOpenIssueCount VanityStatKind = "open-issue-count" 59 59 VanityStatClosedIssueCount VanityStatKind = "closed-issue-count" 60 60 VanityStatRepositoryCount VanityStatKind = "repository-count" 61 + VanityStatStarCount VanityStatKind = "star-count" 61 62 ) 62 63 63 64 func (v VanityStatKind) String() string { ··· 74 75 return "Closed Issues" 75 76 case VanityStatRepositoryCount: 76 77 return "Repositories" 78 + case VanityStatStarCount: 79 + return "Stars" 77 80 } 78 81 return "" 79 82 }
+2 -1
lexicons/actor/profile.json
··· 41 41 "open-pull-request-count", 42 42 "open-issue-count", 43 43 "closed-issue-count", 44 - "repository-count" 44 + "repository-count", 45 + "star-count" 45 46 ] 46 47 } 47 48 },