+8
-4
appview/db/issues.go
+8
-4
appview/db/issues.go
···
359
repoMap[string(repos[i].RepoAt())] = &repos[i]
360
}
361
362
+
for issueAt, i := range issueMap {
363
+
if r, ok := repoMap[string(i.RepoAt)]; ok {
364
+
i.Repo = r
365
+
} else {
366
+
// do not show up the issue if the repo is deleted
367
+
// TODO: foreign key where?
368
+
delete(issueMap, issueAt)
369
+
}
370
}
371
372
// collect comments
+2
-2
appview/db/profile.go
+2
-2
appview/db/profile.go
···
553
query = `select count(id) from pulls where owner_did = ? and state = ?`
554
args = append(args, did, PullOpen)
555
case VanityStatOpenIssueCount:
556
-
query = `select count(id) from issues where owner_did = ? and open = 1`
557
args = append(args, did)
558
case VanityStatClosedIssueCount:
559
-
query = `select count(id) from issues where owner_did = ? and open = 0`
560
args = append(args, did)
561
case VanityStatRepositoryCount:
562
query = `select count(id) from repos where did = ?`
···
553
query = `select count(id) from pulls where owner_did = ? and state = ?`
554
args = append(args, did, PullOpen)
555
case VanityStatOpenIssueCount:
556
+
query = `select count(id) from issues where did = ? and open = 1`
557
args = append(args, did)
558
case VanityStatClosedIssueCount:
559
+
query = `select count(id) from issues where did = ? and open = 0`
560
args = append(args, did)
561
case VanityStatRepositoryCount:
562
query = `select count(id) from repos where did = ?`
+1
-1
appview/pages/markup/markdown.go
+1
-1
appview/pages/markup/markdown.go
+1
-2
appview/repo/repo.go
+1
-2
appview/repo/repo.go
···
11
"log/slog"
12
"net/http"
13
"net/url"
14
-
"path"
15
"path/filepath"
16
"slices"
17
"strconv"
···
710
}
711
712
// fetch the raw binary content using sh.tangled.repo.blob xrpc
713
-
repoName := path.Join("%s/%s", f.OwnerDid(), f.Name)
714
blobURL := fmt.Sprintf("%s://%s/xrpc/sh.tangled.repo.blob?repo=%s&ref=%s&path=%s&raw=true",
715
scheme, f.Knot, url.QueryEscape(repoName), url.QueryEscape(ref), url.QueryEscape(filePath))
716
···
11
"log/slog"
12
"net/http"
13
"net/url"
14
"path/filepath"
15
"slices"
16
"strconv"
···
709
}
710
711
// fetch the raw binary content using sh.tangled.repo.blob xrpc
712
+
repoName := fmt.Sprintf("%s/%s", f.OwnerDid(), f.Name)
713
blobURL := fmt.Sprintf("%s://%s/xrpc/sh.tangled.repo.blob?repo=%s&ref=%s&path=%s&raw=true",
714
scheme, f.Knot, url.QueryEscape(repoName), url.QueryEscape(ref), url.QueryEscape(filePath))
715
-1
appview/state/profile.go
-1
appview/state/profile.go
+1
knotserver/xrpc/repo_blob.go
+1
knotserver/xrpc/repo_blob.go
+8
-6
knotserver/xrpc/repo_branches.go
+8
-6
knotserver/xrpc/repo_branches.go
···
20
21
cursor := r.URL.Query().Get("cursor")
22
23
-
limit := 50 // default
24
-
if limitStr := r.URL.Query().Get("limit"); limitStr != "" {
25
-
if l, err := strconv.Atoi(limitStr); err == nil && l > 0 && l <= 100 {
26
-
limit = l
27
-
}
28
-
}
29
30
gr, err := git.PlainOpen(repoPath)
31
if err != nil {
···
20
21
cursor := r.URL.Query().Get("cursor")
22
23
+
// limit := 50 // default
24
+
// if limitStr := r.URL.Query().Get("limit"); limitStr != "" {
25
+
// if l, err := strconv.Atoi(limitStr); err == nil && l > 0 && l <= 100 {
26
+
// limit = l
27
+
// }
28
+
// }
29
+
30
+
limit := 500
31
32
gr, err := git.PlainOpen(repoPath)
33
if err != nil {