Skip to content

[Bug]: Some Library Stats API values report null for empty libraries #4251

Open
@nickthomsonciq

Description

@nickthomsonciq

What happened?

I noticed the HASS integration for AudioBookshelf was reporting errors, and after tracking it down I discovered it was because the totalSize parameter of api/libraries/library-id/stats for an empty library was null. Additionally totalDuration and numAudioTracks was also null. Given other numeric values in the stats are set to 0, I would assume these three should be as well.

What did you expect to happen?

totalSize, totalDuration and numAudioTracks should be 0 for empty libraries.

Steps to reproduce the issue

  1. Create an empty library
  2. Invoke api/libraries/library-id/stats
  3. View the result

Audiobookshelf version

v2.21.0

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

Additional Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting releaseIssue is resolved and will be in the next releasebugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions