From 006fde502e04d3075bfd7f7f8f5257f7dfd1a353 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Tue, 27 May 2025 18:16:25 +0100 Subject: [PATCH] api-users: GetUserCount with app.jf, not userCache Makes no sense to generate the web user cache for this value. --- api-users.go | 4 ++-- storage.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api-users.go b/api-users.go index dfb930f..26da7fc 100644 --- a/api-users.go +++ b/api-users.go @@ -903,13 +903,13 @@ func (app *appContext) userSummary(jfUser mediabrowser.User) respUser { // @tags Activity func (app *appContext) GetUserCount(gc *gin.Context) { resp := PageCountDTO{} - userList, err := app.userCache.GetUserDTOs(app, false) + users, err := app.jf.GetUsers(false) if err != nil { app.err.Printf(lm.FailedGetUsers, lm.Jellyfin, err) respond(500, "Couldn't get users", gc) return } - resp.Count = uint64(len(userList)) + resp.Count = uint64(len(users)) gc.JSON(200, resp) } diff --git a/storage.go b/storage.go index bab57a3..9a5126b 100644 --- a/storage.go +++ b/storage.go @@ -53,7 +53,7 @@ const ( type Activity struct { ID string `badgerhold:"key"` - Type ActivityType `badgerhold:"index"` + Type ActivityType `badgerhold:"index"` // Index by type for quicker filtering UserID string // ID of target user. For account creation, this will be the newly created account SourceType ActivitySource Source string