feat(API): media field type

This commit is contained in:
Florian Sylvain committed 2026-10-21 05:07:36 +02:00
1 parent ad5faf3d19
commit a2d596f4ca
63 files changed
+2567 -259

No files matched your search

@@ -19,7 +19,7 @@ func siteImageUsage(sites site.Repository) (map[uint32]int, error) {
return usage, nil
}
func imageUsageCount(sites site.Repository, authors author.Repository) (map[uint32]int, error) {
func imageUsageCount(sites site.Repository, authors author.Repository, entries *entryMediaScanner) (map[uint32]int, error) {
usage, err := siteImageUsage(sites)
if err != nil {
return nil, err
@@ -31,5 +31,12 @@ func imageUsageCount(sites site.Repository, authors author.Repository) (map[uint
for imageID, total := range avatars {
usage[imageID] += total
}
entryCounts, err := entries.usageCounts()
if err != nil {
return nil, err
}
for imageID, total := range entryCounts {
usage[imageID] += total
}
return usage, nil
}