@storyteller-platform/align 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -481,7 +481,7 @@ function createMediaOverlay(chapter, sentenceRanges) {
481
481
  import_epub.Epub.createXmlElement(
482
482
  "smil",
483
483
  {
484
- xmlns: "https://www.w3.org/ns/SMIL",
484
+ xmlns: "http://www.w3.org/ns/SMIL",
485
485
  "xmlns:epub": "http://www.idpf.org/2007/ops",
486
486
  version: "3.0"
487
487
  },
@@ -415,7 +415,7 @@ function createMediaOverlay(chapter, sentenceRanges) {
415
415
  Epub.createXmlElement(
416
416
  "smil",
417
417
  {
418
- xmlns: "https://www.w3.org/ns/SMIL",
418
+ xmlns: "http://www.w3.org/ns/SMIL",
419
419
  "xmlns:epub": "http://www.idpf.org/2007/ops",
420
420
  version: "3.0"
421
421
  },
@@ -75,7 +75,7 @@ var import_ghost_story = require("@storyteller-platform/ghost-story");
75
75
  var import_segmentation = require("./segmentation.cjs");
76
76
  var import_semantics = require("./semantics.cjs");
77
77
  async function markup(input, output, options) {
78
- var _a, _b;
78
+ var _a, _b, _c, _d;
79
79
  var _stack = [];
80
80
  try {
81
81
  const timing = (0, import_ghost_story.createAggregator)();
@@ -84,6 +84,7 @@ async function markup(input, output, options) {
84
84
  const epub = __using(_stack, await import_epub.Epub.from(output));
85
85
  const primaryLocale = options.primaryLocale ?? await epub.getLanguage();
86
86
  const spine = await epub.getSpineItems();
87
+ const manifest = await epub.getManifest();
87
88
  for (let index = 0; index < spine.length; index++) {
88
89
  (_a = options.onProgress) == null ? void 0 : _a.call(options, index / spine.length);
89
90
  const spineItem = spine[index];
@@ -91,6 +92,9 @@ async function markup(input, output, options) {
91
92
  `Marking up epub item #${index}: ${(0, import_posix.basename)(spineItem.href)}`
92
93
  );
93
94
  const chapterId = spineItem.id;
95
+ if ((_d = (_c = manifest[chapterId]) == null ? void 0 : _c.properties) == null ? void 0 : _d.includes("nav")) {
96
+ continue;
97
+ }
94
98
  const chapterXml = await epub.readXhtmlItemContents(chapterId);
95
99
  const segmentation = await (0, import_segmentation.getXhtmlSegmentation)(
96
100
  import_epub.Epub.getXhtmlBody(chapterXml),
@@ -14,7 +14,7 @@ import {
14
14
  import { getXhtmlSegmentation } from "./segmentation.js";
15
15
  import { BLOCKS } from "./semantics.js";
16
16
  async function markup(input, output, options) {
17
- var _a, _b;
17
+ var _a, _b, _c, _d;
18
18
  var _stack = [];
19
19
  try {
20
20
  const timing = createAggregator();
@@ -23,6 +23,7 @@ async function markup(input, output, options) {
23
23
  const epub = __using(_stack, await Epub.from(output));
24
24
  const primaryLocale = options.primaryLocale ?? await epub.getLanguage();
25
25
  const spine = await epub.getSpineItems();
26
+ const manifest = await epub.getManifest();
26
27
  for (let index = 0; index < spine.length; index++) {
27
28
  (_a = options.onProgress) == null ? void 0 : _a.call(options, index / spine.length);
28
29
  const spineItem = spine[index];
@@ -30,6 +31,9 @@ async function markup(input, output, options) {
30
31
  `Marking up epub item #${index}: ${basename(spineItem.href)}`
31
32
  );
32
33
  const chapterId = spineItem.id;
34
+ if ((_d = (_c = manifest[chapterId]) == null ? void 0 : _c.properties) == null ? void 0 : _d.includes("nav")) {
35
+ continue;
36
+ }
33
37
  const chapterXml = await epub.readXhtmlItemContents(chapterId);
34
38
  const segmentation = await getXhtmlSegmentation(
35
39
  Epub.getXhtmlBody(chapterXml),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storyteller-platform/align",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "A library and CLI for automatically aligning audiobooks and EPUBs to produce Media Overlays",
5
5
  "author": "Shane Friedman",
6
6
  "license": "MIT",