[PR #4520] [MERGED] Fix podcast episode track index null in playback session #4271

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4520
Author: @advplyr
Created: 7/22/2025
Status: Merged
Merged: 7/22/2025
Merged by: @advplyr

Base: masterHead: fix_podcast_session_track_index


📝 Commits (1)

  • 8c38987 Fix podcast episode track index null in playback session

📊 Changes

2 files changed (+7 additions, -1 deletions)

View changed files

📝 server/controllers/SessionController.js (+6 -1)
📝 server/models/PodcastEpisode.js (+1 -0)

📄 Description

Brief summary

Make sure podcast episode audio track index is always 1 in playback sessions & support 1 or 0 track index in the direct play endpoint.

Which issue is fixed?

Fixes https://github.com/advplyr/audiobookshelf-app/issues/1635

In-depth Description

In v2.21.0 a bug was fixed where podcast episodes scanned in from the file system had an audio track with an index of null. https://github.com/advplyr/audiobookshelf/commit/7c114a051a08d401b5b6dded1620a6f1f92f05c0

In v2.22.0 new API endpoints for direct playing was added that use the audio track index in the url.

When playing an episode with an index value of null in the web client it falls back to transcoding because the track isn't found.

In mobile app v0.10.0-beta the new direct play endpoints are used.
When playing the null index episode on iOS it falls back to transcoding. When playing on Android it crashes the server due to a bug where Android is still using the direct play endpoint when transcoding. That separate bug is how this bug was found.

The fix is to two-fold:

  1. Updated the /public/session/:id/track/:index endpoint to support index 0 or 1 being passed in for podcast episodes.
  2. Update the podcast episode audio track in the playback session to always use index 1

How have you tested this?

Tested on web, iOS and Android with null audio track index


🔄 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/4520 **Author:** [@advplyr](https://github.com/advplyr) **Created:** 7/22/2025 **Status:** ✅ Merged **Merged:** 7/22/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `fix_podcast_session_track_index` --- ### 📝 Commits (1) - [`8c38987`](https://github.com/advplyr/audiobookshelf/commit/8c38987d923af784a6d59de3b2eb98896c01161b) Fix podcast episode track index null in playback session ### 📊 Changes **2 files changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/controllers/SessionController.js` (+6 -1) 📝 `server/models/PodcastEpisode.js` (+1 -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 Make sure podcast episode audio track index is always 1 in playback sessions & support 1 or 0 track index in the direct play endpoint. ## Which issue is fixed? Fixes https://github.com/advplyr/audiobookshelf-app/issues/1635 ## In-depth Description In [v2.21.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.21.0) a bug was fixed where podcast episodes scanned in from the file system had an audio track with an index of `null`. https://github.com/advplyr/audiobookshelf/commit/7c114a051a08d401b5b6dded1620a6f1f92f05c0 In [v2.22.0](https://github.com/advplyr/audiobookshelf/pull/4263) new API endpoints for direct playing was added that use the audio track index in the url. When playing an episode with an index value of `null` in the web client it falls back to transcoding because the track isn't found. In mobile app v0.10.0-beta the new direct play endpoints are used. When playing the `null` index episode on iOS it falls back to transcoding. When playing on Android it crashes the server due to a bug where Android is still using the direct play endpoint when transcoding. That separate bug is how this bug was found. The fix is to two-fold: 1. Updated the `/public/session/:id/track/:index` endpoint to support index `0` or `1` being passed in for podcast episodes. 2. Update the podcast episode audio track in the playback session to always use index 1 ## How have you tested this? Tested on web, iOS and Android with null audio track index --- <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:19:05 +02:00
adam closed this issue 2026-04-25 00:19:05 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4271