[PR #3906] [MERGED] server/podcast: stabilize random ID #4116

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3906
Author: @tharvik
Created: 1/28/2025
Status: Merged
Merged: 1/28/2025
Merged by: @advplyr

Base: masterHead: master


📝 Commits (1)

  • 575927c server/podcast: stabilize random ID

📊 Changes

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

View changed files

📝 server/objects/PodcastEpisodeDownload.js (+1 -1)

📄 Description

Brief summary

when two podcast's episode advertise the same filename, a random ID will get added to ensure that theses do not overlap.

Which issue is fixed?

sadly, the generation of this random ID is redone everytime PodcastEpisodeDownload.targetFilename is accessed and so the filename is changing, making ffmpeg outputting to a different path than excepted.

In-depth Description

there is already an id field in this class, which is, as far as my IDE told me, not used for anything else. it was probably meant to be used for that exact purpose.

How have you tested this?

I actually found the issue when investigating why this podcast wasn't updating anymore. I tried to download two episodes with the same name and it failed with

DEBUG [FfmpegHelpers] downloadPodcastEpisode: Cmd: ffmpeg -i pipe:0 -y -loglevel debug -c:a copy -map 0:a -metadata podcast=1 [...]  -metadata podcast-type=episodic /[...]/Le 12h30 ‐ La 1ère/Le 12h30 - Présenté par Pauline Rappaz (0264cf14-702d-4277-a580-f3bda69e9c6c).mp3
ERROR [PodcastManager] Podcast Episode downloaded but failed to probe "/[...]/Le 12h30 ‐ La 1ère/Le 12h30 - Présenté par Pauline Rappaz (991253f7-0ad8-460c-a6f1-52174bee2288).mp3" No such file or directory

the changing ID gave it away.
then, I dwelled in code and tried out my patch and it worked.

haven't added a testcase, as I didn't saw an already existing test for episode downloads.


🔄 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/3906 **Author:** [@tharvik](https://github.com/tharvik) **Created:** 1/28/2025 **Status:** ✅ Merged **Merged:** 1/28/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`575927c`](https://github.com/advplyr/audiobookshelf/commit/575927c101514b5aa3e6a070200149ae921a8ce8) server/podcast: stabilize random ID ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/objects/PodcastEpisodeDownload.js` (+1 -1) </details> ### 📄 Description <!-- Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary when two podcast's episode advertise the same filename, a random ID will get added to ensure that theses do not overlap. ## Which issue is fixed? sadly, the generation of this random ID is redone everytime `PodcastEpisodeDownload.targetFilename` is accessed and so the filename is changing, making ffmpeg outputting to a different path than excepted. ## In-depth Description there is already an `id` field in this class, which is, as far as my IDE told me, not used for anything else. it was probably meant to be used for that exact purpose. ## How have you tested this? I actually found the issue when investigating why [this podcast](https://podcasts.apple.com/ch/podcast/id311604979) wasn't updating anymore. I tried to download two episodes with the same name and it failed with ``` DEBUG [FfmpegHelpers] downloadPodcastEpisode: Cmd: ffmpeg -i pipe:0 -y -loglevel debug -c:a copy -map 0:a -metadata podcast=1 [...] -metadata podcast-type=episodic /[...]/Le 12h30 ‐ La 1ère/Le 12h30 - Présenté par Pauline Rappaz (0264cf14-702d-4277-a580-f3bda69e9c6c).mp3 ERROR [PodcastManager] Podcast Episode downloaded but failed to probe "/[...]/Le 12h30 ‐ La 1ère/Le 12h30 - Présenté par Pauline Rappaz (991253f7-0ad8-460c-a6f1-52174bee2288).mp3" No such file or directory ``` the changing ID gave it away. then, I dwelled in code and tried out my patch and it worked. haven't added a testcase, as I didn't saw an already existing test for episode downloads. --- <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:22 +02:00
adam closed this issue 2026-04-25 00:18:22 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4116