···75 // TODO: get this in the original query; requires COALESCE because nullable
76 var sourceRepo *models.Repo
77 if repo.Source != "" {
78- sourceRepo, err = GetRepoByAtUri(e, repo.Source)
000079 if err != nil {
80- // the source repo was not found, skip this bit
81 log.Println("profile", "err", err)
82 }
83 }
···449 query = `select count(id) from repos where did = ?`
450 args = append(args, did)
451 case models.VanityStatStarCount:
452- query = `select count(id) from stars where subject_at like 'at://' || ? || '%'`
453 args = append(args, did)
454 case models.VanityStatNone:
455 return 0, nil
···75 // TODO: get this in the original query; requires COALESCE because nullable
76 var sourceRepo *models.Repo
77 if repo.Source != "" {
78+ if strings.HasPrefix(repo.Source, "did:") {
79+ sourceRepo, err = GetRepoByDid(e, repo.Source)
80+ } else {
81+ sourceRepo, err = GetRepoByAtUri(e, repo.Source)
82+ }
83 if err != nil {
084 log.Println("profile", "err", err)
85 }
86 }
···452 query = `select count(id) from repos where did = ?`
453 args = append(args, did)
454 case models.VanityStatStarCount:
455+ query = `select count(s.id) from stars s join repos r on (s.subject_at = r.at_uri or (s.subject_did is not null and s.subject_did = r.repo_did)) where r.did = ?`
456 args = append(args, did)
457 case models.VanityStatNone:
458 return 0, nil