[PR #3182] [MERGED] Add progress and fixes to m4b and embed tools #3892

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

📋 Pull Request Information

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

Base: masterHead: ffmpeg-progress


📝 Commits (4)

  • 10f5f33 Fixes + add progress to m4b and embed tools
  • 7faf42d Merge branch 'advplyr:master' into ffmpeg-progress
  • 7589924 put MessageEmbedFailed in akphabetic order.
  • da51d38 Improve documentation and arg names in TrackProgressMonitor.js

📊 Changes

11 files changed (+529 additions, -210 deletions)

View changed files

📝 client/components/ui/Btn.vue (+4 -2)
📝 client/layouts/default.vue (+17 -0)
📝 client/pages/audiobook/_id/manage.vue (+15 -22)
📝 client/store/tasks.js (+38 -12)
📝 client/strings/en-us.json (+1 -0)
📝 server/managers/AbMergeManager.js (+71 -112)
📝 server/managers/AudioMetadataManager.js (+55 -13)
server/objects/TrackProgressMonitor.js (+88 -0)
📝 server/utils/ffmpegHelpers.js (+118 -13)
test/server/objects/TrackProgressMonitor.test.js (+95 -0)
📝 test/server/utils/ffmpegHelpers.test.js (+27 -36)

📄 Description

This adds progress indicators to the embed and m4b tools, and fixes some issues in those tools.

The main changes:

  • Both embed and m4b tools now show both task and per-track progress in percent
    • In the m4b tool, the per-track progress is calculated according to track durations and ffmpeg progress timemark.
    • The task progress is shown on the button instead of the spinner.
    • The track and task progress are persisted in the store, so they're rememberd when the user leaves and comes back to the tool page.
    • In the m4b tool, since there are two operations happening sequentially (m4b merging and embedding), I made the merging account for 95% of the progress (since it's usually takes much longer), and embedding acount for 5%. This was just just an arbitrary decision.
  • Now checking writability of the directory (in m4b and embed) and write access to the audio files (in embed), before running ffmpeg. This fixes #3143
  • Fixed issue that caused metadata not to be properly embedded after merging, in the m4b tool.
  • Added a TaskFailed indicator to the embed tool UI (it always showed success up until now, even if embedding failed).
  • Removed the redundant worker_threads logic from AbMergeManager, and moved the merging code mergeAudioFiles() in ffmpegHelpers.js
  • Tightened error handling, especially around file system operations.

🔄 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/3182 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 7/20/2024 **Status:** ✅ Merged **Merged:** 7/20/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `ffmpeg-progress` --- ### 📝 Commits (4) - [`10f5f33`](https://github.com/advplyr/audiobookshelf/commit/10f5f331d72dd19e6ca15a5b6341fef368034d9c) Fixes + add progress to m4b and embed tools - [`7faf42d`](https://github.com/advplyr/audiobookshelf/commit/7faf42d8925b4f7f787184fa5290eda586f378ac) Merge branch 'advplyr:master' into ffmpeg-progress - [`7589924`](https://github.com/advplyr/audiobookshelf/commit/75899242fd1bc89e330b562d456ca5ec941aaba7) put MessageEmbedFailed in akphabetic order. - [`da51d38`](https://github.com/advplyr/audiobookshelf/commit/da51d38ba2237e9f7499614b7ad8476c41b696f0) Improve documentation and arg names in TrackProgressMonitor.js ### 📊 Changes **11 files changed** (+529 additions, -210 deletions) <details> <summary>View changed files</summary> 📝 `client/components/ui/Btn.vue` (+4 -2) 📝 `client/layouts/default.vue` (+17 -0) 📝 `client/pages/audiobook/_id/manage.vue` (+15 -22) 📝 `client/store/tasks.js` (+38 -12) 📝 `client/strings/en-us.json` (+1 -0) 📝 `server/managers/AbMergeManager.js` (+71 -112) 📝 `server/managers/AudioMetadataManager.js` (+55 -13) ➕ `server/objects/TrackProgressMonitor.js` (+88 -0) 📝 `server/utils/ffmpegHelpers.js` (+118 -13) ➕ `test/server/objects/TrackProgressMonitor.test.js` (+95 -0) 📝 `test/server/utils/ffmpegHelpers.test.js` (+27 -36) </details> ### 📄 Description This adds progress indicators to the embed and m4b tools, and fixes some issues in those tools. The main changes: - Both embed and m4b tools now show both task and per-track progress in percent - In the m4b tool, the per-track progress is calculated according to track durations and ffmpeg progress timemark. - The task progress is shown on the button instead of the spinner. - The track and task progress are persisted in the store, so they're rememberd when the user leaves and comes back to the tool page. - In the m4b tool, since there are two operations happening sequentially (m4b merging and embedding), I made the merging account for 95% of the progress (since it's usually takes much longer), and embedding acount for 5%. This was just just an arbitrary decision. - Now checking writability of the directory (in m4b and embed) and write access to the audio files (in embed), before running ffmpeg. This fixes #3143 - Fixed issue that caused metadata not to be properly embedded after merging, in the m4b tool. - Added a TaskFailed indicator to the embed tool UI (it always showed success up until now, even if embedding failed). - Removed the redundant worker_threads logic from AbMergeManager, and moved the merging code mergeAudioFiles() in ffmpegHelpers.js - Tightened error handling, especially around file system operations. --- <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:28 +02:00
adam closed this issue 2026-04-25 00:17:28 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3892