[PR #4925] Add ChaptersCueImportModal for importing chapters from .cue files #4374

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4925
Author: @LTe
Created: 12/19/2025
Status: 🔄 Open

Base: masterHead: support-for-cue


📝 Commits (1)

  • 5d5b67a Add ChaptersCueImportModal for importing chapters from .cue files

📊 Changes

4 files changed (+413 additions, -1 deletions)

View changed files

client/components/modals/ChaptersCueImportModal.vue (+206 -0)
client/cypress/tests/components/pages/ChaptersCueImport.cy.js (+157 -0)
📝 client/pages/audiobook/_id/chapters.vue (+44 -1)
📝 client/strings/en-us.json (+6 -0)

📄 Description

Brief summary

Add support for importing chapters from .cue files in the audiobook chapters editor, allowing users to easily apply chapter markers from existing cue sheet files.

Which issue is fixed?

https://github.com/advplyr/audiobookshelf/issues/3181
https://github.com/advplyr/audiobookshelf/issues/2863
https://github.com/advplyr/audiobookshelf/issues/2327

In-depth Description

This PR introduces a new modal component (ChaptersCueImportModal) that enables users to import chapter information from standard .cue files. Cue sheets are commonly used to define track/chapter positions in audio files.

Key features:

  • File selection: Users can select a .cue file via a file picker triggered by the "Import .cue" button on the chapters page
  • CUE parsing: The parser extracts TRACK, TITLE, and INDEX 01 commands, converting MM:SS:FF timecodes (where FF is frames at 75fps) to seconds
  • Preview: Before applying, users can preview all detected chapters with their start times and titles in a scrollable list
  • Error handling: Invalid or empty .cue files display appropriate error messages and disable the apply button
  • Integration: Imported chapters replace existing chapters and automatically calculate end times based on subsequent chapter starts and media duration

Technical details:

  • Parses standard CUE sheet format (ignores REM comments, handles quoted and unquoted titles)
  • Converts frame-based timecodes (75 frames per second) to precise seconds
  • Falls back to "Track N" naming when titles are missing
  • Sorts chapters by start time and filters out invalid entries

How have you tested this?

  • Added Cypress component tests covering:
    • Successful import of valid .cue file with multiple tracks
    • Error handling for empty .cue files
    • Error handling for malformed timecodes
    • Error handling for non-.cue content
  • Manual testing with various .cue files

Run tests: npx cypress run --component --spec "client/cypress/tests/components/pages/ChaptersCueImport.cy.js"

Screenshots

image image

🔄 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/4925 **Author:** [@LTe](https://github.com/LTe) **Created:** 12/19/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `support-for-cue` --- ### 📝 Commits (1) - [`5d5b67a`](https://github.com/advplyr/audiobookshelf/commit/5d5b67a0691baa60cd192ce6f7dcbaf5fd3b7fc1) Add ChaptersCueImportModal for importing chapters from .cue files ### 📊 Changes **4 files changed** (+413 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `client/components/modals/ChaptersCueImportModal.vue` (+206 -0) ➕ `client/cypress/tests/components/pages/ChaptersCueImport.cy.js` (+157 -0) 📝 `client/pages/audiobook/_id/chapters.vue` (+44 -1) 📝 `client/strings/en-us.json` (+6 -0) </details> ### 📄 Description ## Brief summary Add support for importing chapters from .cue files in the audiobook chapters editor, allowing users to easily apply chapter markers from existing cue sheet files. ## Which issue is fixed? https://github.com/advplyr/audiobookshelf/issues/3181 https://github.com/advplyr/audiobookshelf/issues/2863 https://github.com/advplyr/audiobookshelf/issues/2327 ## In-depth Description This PR introduces a new modal component (`ChaptersCueImportModal`) that enables users to import chapter information from standard .cue files. Cue sheets are commonly used to define track/chapter positions in audio files. **Key features:** - **File selection**: Users can select a .cue file via a file picker triggered by the "Import .cue" button on the chapters page - **CUE parsing**: The parser extracts TRACK, TITLE, and INDEX 01 commands, converting MM:SS:FF timecodes (where FF is frames at 75fps) to seconds - **Preview**: Before applying, users can preview all detected chapters with their start times and titles in a scrollable list - **Error handling**: Invalid or empty .cue files display appropriate error messages and disable the apply button - **Integration**: Imported chapters replace existing chapters and automatically calculate end times based on subsequent chapter starts and media duration **Technical details:** - Parses standard CUE sheet format (ignores REM comments, handles quoted and unquoted titles) - Converts frame-based timecodes (75 frames per second) to precise seconds - Falls back to "Track N" naming when titles are missing - Sorts chapters by start time and filters out invalid entries ## How have you tested this? - Added Cypress component tests covering: - Successful import of valid .cue file with multiple tracks - Error handling for empty .cue files - Error handling for malformed timecodes - Error handling for non-.cue content - Manual testing with various .cue files Run tests: `npx cypress run --component --spec "client/cypress/tests/components/pages/ChaptersCueImport.cy.js"` ## Screenshots <img width="1429" height="493" alt="image" src="https://github.com/user-attachments/assets/f5ca9109-1c90-4611-88c5-5c8060c8f6ff" /> <img width="610" height="632" alt="image" src="https://github.com/user-attachments/assets/abe553d6-4832-473c-b4f7-3a116c0153f9" /> --- <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:30 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4374