@pixwel/pixwel-sdk 2.1.18 → 2.1.19

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.
@@ -327,19 +327,19 @@ var Ingest = function (_Model) {
327
327
 
328
328
  var tags = {};
329
329
 
330
- if (!info.File) {
331
- throw "missing info.File";
330
+ if (!info.media) {
331
+ throw "missing info.media";
332
332
  }
333
333
 
334
- if (!info.File.track) {
335
- throw "missing info.File.track";
334
+ if (!info.media.track) {
335
+ throw "missing info.media.track";
336
336
  }
337
337
 
338
338
  var general = void 0;
339
- if (!Array.isArray(info["File"]["track"])) {
340
- general = info["File"]["track"];
339
+ if (!Array.isArray(info["media"]["track"])) {
340
+ general = info["media"]["track"];
341
341
  } else {
342
- general = _lodash2.default.find(info["File"]["track"], { _type: "General" });
342
+ general = _lodash2.default.find(info["media"]["track"], { _type: "General" });
343
343
  }
344
344
 
345
345
  switch (mediaType) {
@@ -366,7 +366,7 @@ var Ingest = function (_Model) {
366
366
  ScanType: ""
367
367
  };
368
368
 
369
- var media = _lodash2.default.find(info["File"]["track"], {
369
+ var media = _lodash2.default.find(info["media"]["track"], {
370
370
  _type: mediaType
371
371
  });
372
372
  media = _lodash2.default.merge({}, mediainfoDefaults, media);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixwel/pixwel-sdk",
3
3
  "description": "",
4
- "version": "2.1.18",
4
+ "version": "2.1.19",
5
5
  "author": "Pixwel",
6
6
  "license": "UNLICENSED",
7
7
  "main": "./dist/index.js",
package/src/Ingest.js CHANGED
@@ -302,19 +302,19 @@ export default class Ingest extends Model {
302
302
 
303
303
  let tags = {};
304
304
 
305
- if (!info.File) {
306
- throw "missing info.File";
305
+ if (!info.media) {
306
+ throw "missing info.media";
307
307
  }
308
308
 
309
- if (!info.File.track) {
310
- throw "missing info.File.track";
309
+ if (!info.media.track) {
310
+ throw "missing info.media.track";
311
311
  }
312
312
 
313
313
  let general;
314
- if (!Array.isArray(info["File"]["track"])) {
315
- general = info["File"]["track"];
314
+ if (!Array.isArray(info["media"]["track"])) {
315
+ general = info["media"]["track"];
316
316
  } else {
317
- general = _.find(info["File"]["track"], { _type: "General" });
317
+ general = _.find(info["media"]["track"], { _type: "General" });
318
318
  }
319
319
 
320
320
  switch (mediaType) {
@@ -341,7 +341,7 @@ export default class Ingest extends Model {
341
341
  ScanType: ""
342
342
  };
343
343
 
344
- let media = _.find(info["File"]["track"], {
344
+ let media = _.find(info["media"]["track"], {
345
345
  _type: mediaType
346
346
  });
347
347
  media = _.merge({}, mediainfoDefaults, media);
@@ -1,6 +1,7 @@
1
1
  import { Ingest, Order } from "../index";
2
2
 
3
3
  import mock from "./mocks/mediainfo.mock";
4
+ import mock4x3 from "./mocks/mediainfo-4x3.mock";
4
5
  import proresMock from "./mocks/prores.mock";
5
6
  import pngMock from "./mocks/mediainfo.png.mock";
6
7
  import mxfMock from "./mocks/mediainfo.mxf.mock";
@@ -698,19 +699,14 @@ describe("Ingest", () => {
698
699
  language: "ENG",
699
700
  country: "WW",
700
701
  tags: {
701
- Extra: [],
702
- SubDub: {
703
- sub: null,
704
- dub: null
705
- },
706
- Resolution: "720x486",
707
- Codec: "prores",
708
- "Frame Mode": "progressive",
709
- Framerate: "23.98",
710
702
  Standard: "ntsc",
711
- Usage: "broadcast",
712
703
  Aspect: "16:9",
713
- Text: "txtd"
704
+ Resolution: "1920x1080",
705
+ "Frame Mode": "progressive",
706
+ Framerate: "29.97",
707
+ Text: "txtd",
708
+ Extra: ["COMING-SOON", "HOJE"],
709
+ Codec: "PRORES"
714
710
  }
715
711
  }
716
712
  }
@@ -721,7 +717,7 @@ describe("Ingest", () => {
721
717
  let extension = "mp4";
722
718
  let name = ingest.renderFilename({ allTags, allTypes, extension });
723
719
  expect(name).toBe(
724
- "TESTPROJECT_ITR-TEST-ASSET-A_ENG_TXTD_PRORES_NTSC-16X9_486p2398.mp4"
720
+ "TESTPROJECT_ITR-TEST-ASSET-A_ENG_TXTD_COMING-SOON_HOJE_PRORES_NTSC-16X9_1080p2997.mp4"
725
721
  );
726
722
  });
727
723
  it("renders `set` tags when all tags in `set` are specified but retains `codec`", function() {
@@ -1037,7 +1033,7 @@ describe("Ingest", () => {
1037
1033
  }
1038
1034
  },
1039
1035
  mediainfo: {
1040
- File: { track: {} }
1036
+ media: { track: {} }
1041
1037
  },
1042
1038
  selected: {
1043
1039
  download: {
@@ -1319,7 +1315,7 @@ describe("Ingest", () => {
1319
1315
  });
1320
1316
  });
1321
1317
  describe("mapFromMediainfo", () => {
1322
- it("should throw exception if missing File object", () => {
1318
+ it("should throw exception if missing media object", () => {
1323
1319
  let meta = {};
1324
1320
  expect(() => {
1325
1321
  let ingest = new Ingest({
@@ -1327,20 +1323,20 @@ describe("Ingest", () => {
1327
1323
  mediainfo: meta
1328
1324
  });
1329
1325
  let info = ingest.mapFromMediainfo();
1330
- }).toThrow("missing info.File");
1326
+ }).toThrow("missing info.media");
1331
1327
  });
1332
- it("should throw exception if missing File.track object", () => {
1333
- let meta = { File: {} };
1328
+ it("should throw exception if missing media.track object", () => {
1329
+ let meta = { media: {} };
1334
1330
  expect(() => {
1335
1331
  let ingest = new Ingest({
1336
1332
  source: { mediaType: "video" },
1337
1333
  mediainfo: meta
1338
1334
  });
1339
1335
  let info = ingest.mapFromMediainfo();
1340
- }).toThrow("missing info.File.track");
1336
+ }).toThrow("missing info.media.track");
1341
1337
  });
1342
1338
  it("should return empty object of tags if no metadata supplied", () => {
1343
- let meta = { File: { track: {} } };
1339
+ let meta = { media: { track: {} } };
1344
1340
  let ingest = new Ingest({
1345
1341
  source: { mediaType: "video" },
1346
1342
  mediainfo: meta
@@ -0,0 +1,76 @@
1
+
2
+ module.exports = {
3
+ File: {
4
+ track: [
5
+ {
6
+ Complete_name:
7
+ "https://slurpee3-encode-bucket.s3.us-west-2.amazonaws.com/encoded/5d729ee130c5782b008b456e.mov?AWSAccessKeyId=ASIA6POTFMFMZCJQFKMU&Expires=1567796481&Signature=LgyMuh65spyyt%2F%2FSyOnr4Jxqs0g%3D&x-amz-security-token=AgoJb3JpZ2luX2VjEKr%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLXdlc3QtMiJHMEUCIQDieWUmrxT0AzYzVxzFv%2FPPorrdWtMNQwGo8L9UdlGvgQIgW7JgNXI5uU3fmv1DWCatjm8A17HvMucz6%2BvamgIlxRAqmwIIYxAAGgw5OTUyNjQ2NTE2MDkiDBnCi08PK03Wx7FM4Cr4AZKz6X7mA%2B4uRPysQxLquVuGhm%2BT3y5LN0naVSJri79wGtMskSHTGcLSO1mR5YMJgPM%2BLG%2BK1O8UdxohgNitGYgdsSvVKqUYQoVbRFvCkwMtxHVUuh37rBgjug26BkfyWm7F9dJEuLDP2YMIshhP0Iys81dX%2BU6p7tuA2KDY10Or0%2Bo6j3OgvKezwnL40aFM3bLR7Mjc7CcwKIeUj3%2FLADhlAfxxd4jVHCNyYs8d0oXE689PWhAUjqnLfm5s7sG5dR7bJhq8Bgv%2BrdbVcvKODOg2y33JsweUXJG0hnydMACnsOjJmUxgE7hlrVkBz%2BKE5aYgNOF7w8%2FSMPC9yusFOrQB90%2BMdanLrtCez%2Bl9fg5Eas3sNdg9Kflg4MxGZ70yU6ukLKGILmi1fneLBa2CxR1UrtOJJiT5ECRrUY68RdRq4OlZRrSXW5AxTjyn2KLn5OVPHY8VcxfwdkxzQbxmDyoFGWSnsch5nS5LU0snKRQe4h7dGUYLNnWsUR5PceG9dZJeORP6YXHtB%2FmVG%2Fv0AlpGo8Z7qXicVMLL6MuPPT3bPa%2BVKb%2FrZCWF5jw5l1kjHx%2FxzmzS",
8
+ Format: "MPEG-4",
9
+ Format_profile: "QuickTime",
10
+ Codec_ID: "qt 2005.03 (qt )",
11
+ File_size: "8.03 MiB",
12
+ Duration: "1 s 68 ms",
13
+ Overall_bit_rate_mode: "Variable",
14
+ Overall_bit_rate: "63.1 Mb/s",
15
+ Encoded_date: "UTC 2019-09-06 18:01:18",
16
+ Tagged_date: "UTC 2019-09-06 18:01:18",
17
+ FileExtension_Invalid:
18
+ "mov mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4v",
19
+ _type: "General"
20
+ },
21
+ {
22
+ ID: "1",
23
+ Format: "ProRes",
24
+ Format_version: "Version 0",
25
+ Format_profile: "422 HQ",
26
+ Codec_ID: "apch",
27
+ Duration: "1 s 68 ms",
28
+ Bit_rate_mode: "Variable",
29
+ Bit_rate: "61.2 Mb/s",
30
+ Width: "720 pixels",
31
+ Clean_aperture_width: "704 pixels",
32
+ Height: "486 pixels",
33
+ Clean_aperture_height: "480 pixels",
34
+ Display_aspect_ratio: "4:3",
35
+ Clean_aperture_display_aspect_ratio: "4:3",
36
+ Frame_rate_mode: "Constant",
37
+ Frame_rate: "29.970 (30000/1001) FPS",
38
+ Standard: "NTSC",
39
+ Color_space: "YUV",
40
+ Chroma_subsampling: "4:2:2",
41
+ Scan_type: "Progressive",
42
+ Bits__Pixel_Frame_: "5.833",
43
+ Stream_size: "7.79 MiB (97%)",
44
+ Writing_library: "ael0",
45
+ Language: "English",
46
+ Encoded_date: "UTC 2019-09-06 18:01:18",
47
+ Tagged_date: "UTC 2019-09-06 18:01:18",
48
+ Color_primaries: "BT.709",
49
+ Transfer_characteristics: "BT.709",
50
+ Matrix_coefficients: "BT.709",
51
+ matrix_coefficients_Original: "BT.601",
52
+ _type: "Video"
53
+ },
54
+ {
55
+ ID: "2",
56
+ Format: "PCM",
57
+ Format_settings__Endianness: "Little",
58
+ Format_settings__Sign: "Signed",
59
+ Codec_ID: "lpcm",
60
+ Duration: "1 s 61 ms",
61
+ Bit_rate_mode: "Constant",
62
+ Bit_rate: "1 536 kb/s",
63
+ Channel_s_: "2 channels",
64
+ Channel_positions: "Front: L R",
65
+ Sampling_rate: "48.0 kHz",
66
+ Bit_depth: "16 bits",
67
+ Stream_size: "199 KiB (2%)",
68
+ Language: "English",
69
+ Encoded_date: "UTC 2019-09-06 18:01:18",
70
+ Tagged_date: "UTC 2019-09-06 18:01:18",
71
+ _type: "Audio"
72
+ }
73
+ ]
74
+ },
75
+ _version: "0.7.92.1"
76
+ };
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- File: {
2
+ media: {
3
3
  track: [
4
4
  {
5
5
  VideoCount: "1",
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- File: {
2
+ media: {
3
3
  track: [
4
4
  {
5
5
  Format: "MXF",
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- File: {
2
+ media: {
3
3
  track: [
4
4
  {
5
5
  Format: "PNG",
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- File: {
2
+ media: {
3
3
  track: [
4
4
  {
5
5
  _type: "General",