[PR #3204] [MERGED] Fix permission issues in embed/merge #3898

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3204
Author: @mikiher
Created: 7/29/2024
Status: Merged
Merged: 7/29/2024
Merged by: @advplyr

Base: masterHead: embed-permissions


📝 Commits (1)

  • 294490f Fix permission issues in embed/merge

📊 Changes

4 files changed (+105 additions, -34 deletions)

View changed files

📝 server/managers/AbMergeManager.js (+25 -8)
📝 server/utils/ffmpegHelpers.js (+6 -4)
📝 server/utils/fileUtils.js (+43 -0)
📝 test/server/utils/ffmpegHelpers.test.js (+31 -22)

📄 Description

This fixes #3146.

This changes the way the output of the embedding/merging tools is written back to the original directory, so that the permissions of the original audio files are kept intact.

Before this, we used fs.move(), which moved the ffmpeg output to the original file, effectively replacing the original permissions with whatever permissions the ffmpeg process assigned to its output file. Instead, we now pipe the contents of the ffmpeg output into the original file, so the contents of the original file are replaced but all file attributes (e.g. permissions) remain intact.


🔄 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/3204 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 7/29/2024 **Status:** ✅ Merged **Merged:** 7/29/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `embed-permissions` --- ### 📝 Commits (1) - [`294490f`](https://github.com/advplyr/audiobookshelf/commit/294490f81455d57b7ecd403b4033a290727cf81e) Fix permission issues in embed/merge ### 📊 Changes **4 files changed** (+105 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `server/managers/AbMergeManager.js` (+25 -8) 📝 `server/utils/ffmpegHelpers.js` (+6 -4) 📝 `server/utils/fileUtils.js` (+43 -0) 📝 `test/server/utils/ffmpegHelpers.test.js` (+31 -22) </details> ### 📄 Description This fixes #3146. This changes the way the output of the embedding/merging tools is written back to the original directory, so that the permissions of the original audio files are kept intact. Before this, we used fs.move(), which moved the ffmpeg output to the original file, effectively replacing the original permissions with whatever permissions the ffmpeg process assigned to its output file. Instead, we now pipe the contents of the ffmpeg output into the original file, so the contents of the original file are replaced but all file attributes (e.g. permissions) remain intact. --- <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:17:29 +02:00
adam closed this issue 2026-04-25 00:17:29 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3898