jf-activity: initial changes

functionality mostly there but needs a UI.
This commit is contained in:
Harvey Tindall
2025-12-16 18:15:39 +00:00
parent e4e9369d54
commit c21df253a1
11 changed files with 435 additions and 14 deletions
+23
View File
@@ -1418,3 +1418,26 @@ func (app *appContext) ApplySettings(gc *gin.Context) {
app.InvalidateUserCaches()
gc.JSON(code, errors)
}
// @Summary Get the latest Jellyfin/Emby activities related to the given user ID. Returns as many as the server has recorded.
// @Produce json
// @Success 200 {object} ActivityLogEntriesDTO
// @Failure 400 {object} boolResponse
// @Param id path string true "id of user to fetch activities of."
// @Router /users/{id}/activities/jellyfin [get]
// @Security Bearer
// @tags Users
func (app *appContext) GetJFActivitesForUser(gc *gin.Context) {
userId := gc.Param("id")
if userId == "" {
respondBool(400, false, gc)
return
}
activities, err := app.jf.activity.ByUserID(userId)
if err != nil {
app.err.Printf(lm.FailedGetJFActivities, err)
respondBool(400, false, gc)
return
}
gc.JSON(200, ActivityLogEntriesDTO{Entries: activities})
}