[PR #4168] [MERGED] Create new StatsController and move year in review stats endpoint #4184

Closed
opened 2026-04-25 00:18:41 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4168
Author: @advplyr
Created: 3/29/2025
Status: Merged
Merged: 3/29/2025
Merged by: @advplyr

Base: masterHead: new_stats_controller


📝 Commits (2)

  • 4fb5330 Create new StatsController and move year in review stats endpoint
  • 73c1ea9 Add admin middleware for StatsController

📊 Changes

3 files changed (+128 additions, -3 deletions)

View changed files

server/controllers/StatsController.js (+75 -0)
📝 server/routers/ApiRouter.js (+7 -3)
📝 server/utils/queries/adminStats.js (+46 -0)

📄 Description

Brief summary

Create StatsController in preparation for new server stats page. Moves existing year in review stats endpoint to StatsController.

Which issue is fixed?

None

In-depth Description

This also sets up a server stats endpoint at /api/stats/server that returns the following data so far.

{
  "books": {
    "totalSize": 46370467418,
    "numItems": 221,
    "numAudioFiles": 2586
  },
  "podcasts": {
    "totalSize": 9962023922,
    "numItems": 70,
    "numAudioFiles": 80
  },
  "total": {
    "totalSize": 56332491340,
    "numItems": 291,
    "numAudioFiles": 2666
  }
}

This will likely change as the server stats page gets realized.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/4168 **Author:** [@advplyr](https://github.com/advplyr) **Created:** 3/29/2025 **Status:** ✅ Merged **Merged:** 3/29/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `new_stats_controller` --- ### 📝 Commits (2) - [`4fb5330`](https://github.com/advplyr/audiobookshelf/commit/4fb53303087659065ae0bacf2cac5714dd62ad72) Create new StatsController and move year in review stats endpoint - [`73c1ea9`](https://github.com/advplyr/audiobookshelf/commit/73c1ea92f345f24341ea88bcdf634e9ef97e86ca) Add admin middleware for StatsController ### 📊 Changes **3 files changed** (+128 additions, -3 deletions) <details> <summary>View changed files</summary> ➕ `server/controllers/StatsController.js` (+75 -0) 📝 `server/routers/ApiRouter.js` (+7 -3) 📝 `server/utils/queries/adminStats.js` (+46 -0) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary Create StatsController in preparation for new server stats page. Moves existing year in review stats endpoint to StatsController. ## Which issue is fixed? None ## In-depth Description This also sets up a server stats endpoint at `/api/stats/server` that returns the following data so far. ```json { "books": { "totalSize": 46370467418, "numItems": 221, "numAudioFiles": 2586 }, "podcasts": { "totalSize": 9962023922, "numItems": 70, "numAudioFiles": 80 }, "total": { "totalSize": 56332491340, "numItems": 291, "numAudioFiles": 2666 } } ``` This will likely change as the server stats page gets realized. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:41 +02:00
adam closed this issue 2026-04-25 00:18:41 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4184