[PR #3689] [MERGED] Resolved a server crash when a playback session lacked media metadata #4053

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3689
Author: @Vito0912
Created: 12/7/2024
Status: Merged
Merged: 12/7/2024
Merged by: @advplyr

Base: masterHead: feat/fixServercrashPlaybacksession


📝 Commits (1)

  • 7486d63 Resolved a server crash when a playback session lacked associated media metadata.

📊 Changes

1 file changed (+3 additions, -3 deletions)

View changed files

📝 server/utils/queries/userStats.js (+3 -3)

📄 Description

Brief Summary

This PR introduces optional operators to allow stats to function without media metadata for playback Sessions. This change prevents server crashes when media metadata is absent.

In-depth Description

The logic for handling authors, narrators, genres has been updated to handle cases where mediaMetadata is absent. This ensures that the server can generate responses without requiring metadata, thereby preventing crashes.

A follow-up PR should be made to pull the mediaMetadata when missing from request.

How Have You Tested This?

Tested on a personal server.


🔄 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/3689 **Author:** [@Vito0912](https://github.com/Vito0912) **Created:** 12/7/2024 **Status:** ✅ Merged **Merged:** 12/7/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `feat/fixServercrashPlaybacksession` --- ### 📝 Commits (1) - [`7486d63`](https://github.com/advplyr/audiobookshelf/commit/7486d6345dd03357a6e069bd789cdaad5da785c2) Resolved a server crash when a playback session lacked associated media metadata. ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `server/utils/queries/userStats.js` (+3 -3) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature. For more details, see [Introducing Draft Pull Requests](https://github.blog/2019-02-14-introducing-draft-pull-requests/). If this template is not followed, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, workflows will need manual approval before they run. --> ## Brief Summary <!-- Please provide a brief summary of what your PR aims to achieve. --> This PR introduces optional operators to allow stats to function without media metadata for playback Sessions. This change prevents server crashes when media metadata is absent. ## In-depth Description <!-- Describe your solution in more depth. How does it work? Why is this the best solution? Does it address a broader issue or is it specific to your setup? --> The logic for handling authors, narrators, genres has been updated to handle cases where `mediaMetadata` is absent. This ensures that the server can generate responses without requiring metadata, thereby preventing crashes. A follow-up PR should be made to pull the `mediaMetadata` when missing from request. ## How Have You Tested This? <!-- Please describe in detail with reproducible steps how you tested your changes. --> Tested on a personal server. --- <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:08 +02:00
adam closed this issue 2026-04-25 00:18:08 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4053