taglib-ts
    Preparing search index...

    Class Mp4ChapterHolderAbstract

    Abstract base class for chapter list holders.

    Implements the lazy-read / dirty-write pattern used by both Nero and QuickTime chapter implementations:

    • Chapters are read from disk only on first access.
    • Chapters are written to disk only when they have been modified.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _chapters: Mp4Chapter[] = []

    The currently-held chapter list (may not yet be loaded from disk).

    _loaded: boolean = false

    Whether chapters have been loaded from disk at least once.

    _modified: boolean = false

    Whether the in-memory chapter list differs from what is on disk.

    Accessors

    • get isModified(): boolean

      Returns true if the in-memory chapter list has been modified.

      Returns boolean

    Methods

    • Reads chapters from disk into _chapters.

      Parameters

      Returns Promise<boolean>

      true if chapters were found on disk.

    • Writes the chapter list to disk only if it has been modified.

      Parameters

      Returns Promise<boolean>

      true if successful (or if no write was needed).

    • Updates the chapter list, marking it as modified if the new list differs from the current one or if the holder was not yet loaded.

      Parameters

      Returns void

    • Sets _modified directly (used in tests / mock subclasses).

      Parameters

      • value: boolean

        New modified state.

      Returns void

    • Writes _chapters to disk.

      Parameters

      Returns Promise<boolean>

      true on success.