activities: fix slow load w/ lots of users
Added ID/Name indexing to mediabrowser, and cleaned it up a little bit. Was taking ~2s with 5000 users and firing tons of requests at Jellyfin, now take ~160ms from cold boot, ~1ms with cache.
This commit is contained in:
@@ -119,7 +119,6 @@ func (app *appContext) GetActivities(gc *gin.Context) {
|
||||
|
||||
var results []Activity
|
||||
err := app.storage.db.Find(&results, query)
|
||||
|
||||
if err != nil {
|
||||
app.err.Printf(lm.FailedDBReadActivities, err)
|
||||
}
|
||||
@@ -128,7 +127,6 @@ func (app *appContext) GetActivities(gc *gin.Context) {
|
||||
Activities: make([]ActivityDTO, len(results)),
|
||||
}
|
||||
resp.LastPage = len(results) != req.Limit
|
||||
|
||||
for i, act := range results {
|
||||
resp.Activities[i] = ActivityDTO{
|
||||
ID: act.ID,
|
||||
|
||||
Reference in New Issue
Block a user