@pixwel/pixwel-sdk 1.1.7 → 1.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.
- package/coverage/clover.xml +469 -3
- package/coverage/coverage-final.json +10 -1
- package/coverage/lcov-report/Ass.js.html +208 -208
- package/coverage/lcov-report/Asset.js.html +4 -4
- package/coverage/lcov-report/Filename.js.html +31 -64
- package/coverage/lcov-report/Ingest.js.html +634 -172
- package/coverage/lcov-report/IngestFile.js.html +1 -1
- package/coverage/lcov-report/IngestFileDrop.js.html +3 -3
- package/coverage/lcov-report/Order.js.html +62 -26
- package/coverage/lcov-report/Srt.js.html +90 -90
- package/coverage/lcov-report/Sub.js.html +43 -43
- package/coverage/lcov-report/TimeFormat.js.html +61 -61
- package/coverage/lcov-report/index.html +128 -11
- package/coverage/lcov.info +967 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +0 -9
- package/dist/src/Filename.js +3 -10
- package/dist/src/Ingest.js +241 -88
- package/dist/src/Order.js +12 -0
- package/index.js +0 -1
- package/package.json +32 -26
- package/src/Filename.js +3 -14
- package/src/Ingest.js +241 -91
- package/src/Order.js +13 -1
- package/test/Filename.spec.js +74 -38
- package/test/Ingest.spec.js +306 -68
- package/test/mocks/mediainfo.mock.js +89 -66
- package/test/mocks/mocks.js +5 -1
- package/test/mocks/prores.mock.js +119 -70
- package/.vscode/launch.json +0 -0
- package/dist/src/IngestFileDrop.js +0 -178
- package/src/IngestFileDrop.js +0 -157
- package/src/docs.json +0 -1
|
@@ -1,71 +1,120 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
2
|
+
File: {
|
|
3
|
+
track: [
|
|
4
|
+
{
|
|
5
|
+
_type: "General",
|
|
6
|
+
VideoCount: "1",
|
|
7
|
+
AudioCount: "1",
|
|
8
|
+
OtherCount: "1",
|
|
9
|
+
FileExtension: "mp4",
|
|
10
|
+
Format: "MPEG-4",
|
|
11
|
+
Format_Profile: "QuickTime",
|
|
12
|
+
CodecID: "qt",
|
|
13
|
+
FileSize: "132980532",
|
|
14
|
+
Duration: "6.006",
|
|
15
|
+
OverallBitRate_Mode: "VBR",
|
|
16
|
+
OverallBitRate: "177130240",
|
|
17
|
+
FrameRate: "23.976",
|
|
18
|
+
FrameCount: "144",
|
|
19
|
+
StreamSize: "1048580",
|
|
20
|
+
HeaderSize: "1048568",
|
|
21
|
+
DataSize: "131931964",
|
|
22
|
+
FooterSize: "0",
|
|
23
|
+
IsStreamable: "Yes",
|
|
24
|
+
Encoded_Date: "UTC 2018-01-31 17:35:26",
|
|
25
|
+
Tagged_Date: "UTC 2018-01-31 17:36:10",
|
|
26
|
+
File_Modified_Date: "UTC 2018-07-02 23:18:18",
|
|
27
|
+
File_Modified_Date_Local: "2018-07-02 18:18:18",
|
|
28
|
+
Encoded_Library: "Apple QuickTime",
|
|
29
|
+
Encoded_Library_Name: "Apple QuickTime",
|
|
30
|
+
extra: {
|
|
31
|
+
TIM: "01:00:00:00",
|
|
32
|
+
TSC: "24000",
|
|
33
|
+
TSZ: "1001"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
_type: "Video",
|
|
38
|
+
StreamOrder: "0",
|
|
39
|
+
ID: "1",
|
|
40
|
+
Format: "ProRes",
|
|
41
|
+
Format_Version: "0",
|
|
42
|
+
Format_Profile: "422 HQ",
|
|
43
|
+
CodecID: "apch",
|
|
44
|
+
Duration: "6.006",
|
|
45
|
+
BitRate_Mode: "VBR",
|
|
46
|
+
BitRate: "173429362",
|
|
47
|
+
Width: "1920",
|
|
48
|
+
Height: "1080",
|
|
49
|
+
PixelAspectRatio: "1.000",
|
|
50
|
+
DisplayAspectRatio: "1.778",
|
|
51
|
+
Rotation: "0.000",
|
|
52
|
+
FrameRate_Mode: "CFR",
|
|
53
|
+
FrameRate: "23.976",
|
|
54
|
+
FrameCount: "144",
|
|
55
|
+
ColorSpace: "YUV",
|
|
56
|
+
ChromaSubsampling: "4:2:2",
|
|
57
|
+
ScanType: "Progressive",
|
|
58
|
+
Delay: "3600.000",
|
|
59
|
+
StreamSize: "130202224",
|
|
60
|
+
Encoded_Library: "aut0",
|
|
61
|
+
Language: "en",
|
|
62
|
+
Encoded_Date: "UTC 2018-01-31 17:35:26",
|
|
63
|
+
Tagged_Date: "UTC 2018-01-31 17:35:26",
|
|
64
|
+
colour_description_present: "Yes",
|
|
65
|
+
colour_primaries: "BT.709",
|
|
66
|
+
transfer_characteristics: "BT.709",
|
|
67
|
+
matrix_coefficients: "BT.709",
|
|
68
|
+
colour_description_present_Original: "Yes",
|
|
69
|
+
matrix_coefficients_Original: "BT.709",
|
|
70
|
+
extra: {
|
|
71
|
+
Menus: "0"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
_type: "Audio",
|
|
76
|
+
StreamOrder: "1",
|
|
77
|
+
ID: "2",
|
|
78
|
+
Format: "PCM",
|
|
79
|
+
Format_Settings_Endianness: "Little",
|
|
80
|
+
Format_Settings_Sign: "Signed",
|
|
81
|
+
CodecID: "in24",
|
|
82
|
+
Duration: "6.006",
|
|
83
|
+
BitRate_Mode: "CBR",
|
|
84
|
+
BitRate: "2304000",
|
|
85
|
+
Channels: "2",
|
|
86
|
+
ChannelPositions: "Front: L R",
|
|
87
|
+
ChannelLayout: "L R",
|
|
88
|
+
SamplingRate: "48000",
|
|
89
|
+
SamplingCount: "288288",
|
|
90
|
+
BitDepth: "24",
|
|
91
|
+
Delay: "3600.000",
|
|
92
|
+
Delay_DropFrame: "No",
|
|
93
|
+
Delay_Source: "Container",
|
|
94
|
+
StreamSize: "1729728",
|
|
95
|
+
StreamSize_Proportion: "0.01301",
|
|
96
|
+
Language: "en",
|
|
97
|
+
Encoded_Date: "UTC 2018-01-31 17:35:26",
|
|
98
|
+
Tagged_Date: "UTC 2018-01-31 17:35:26",
|
|
99
|
+
extra: {
|
|
100
|
+
Menus: "0"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
_type: "Other",
|
|
105
|
+
StreamOrder: "2",
|
|
106
|
+
ID: "3",
|
|
107
|
+
Type: "Time code",
|
|
108
|
+
Format: "QuickTime TC",
|
|
109
|
+
Duration: "6.006",
|
|
110
|
+
TimeCode_FirstFrame: "01:00:00:00",
|
|
111
|
+
TimeCode_Striped: "Yes",
|
|
112
|
+
Language: "en",
|
|
113
|
+
extra: {
|
|
114
|
+
Encoded_Date: "UTC 2018-01-31 17:35:26",
|
|
115
|
+
Tagged_Date: "UTC 2018-01-31 17:35:26"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
};
|
package/.vscode/launch.json
DELETED
|
File without changes
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
|
-
|
|
9
|
-
var _pixwelSdk = require("@pixwel/pixwel-sdk");
|
|
10
|
-
|
|
11
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Collects file handles from HTML5, full paths from Aspera, inspects
|
|
15
|
-
* the dropped file using mediainfo, then renames the file according to
|
|
16
|
-
* the data from Mediainfo and the Order and submits it for upload.
|
|
17
|
-
* @type {Object}
|
|
18
|
-
*/
|
|
19
|
-
var IngestFileDrop = function () {
|
|
20
|
-
/**
|
|
21
|
-
* Map that contains data from HTML5 file drop and Aspera file drop
|
|
22
|
-
* @type {Object}
|
|
23
|
-
*/
|
|
24
|
-
function IngestFileDrop(scope, Mediainfo, IngestUpload) {
|
|
25
|
-
_classCallCheck(this, IngestFileDrop);
|
|
26
|
-
|
|
27
|
-
this.map = {};
|
|
28
|
-
this.scope = scope;
|
|
29
|
-
this.IngestUpload = IngestUpload;
|
|
30
|
-
this.Mediainfo = Mediainfo;
|
|
31
|
-
this.asperaDropHandler = this.asperaDropHandler.bind(this);
|
|
32
|
-
this.htmlDropHandler = this.htmlDropHandler.bind(this);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* HTML file drop handler
|
|
36
|
-
* @param {[type]} e [description]
|
|
37
|
-
* @return {[type]} [description]
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_createClass(IngestFileDrop, [{
|
|
42
|
-
key: "htmlDropHandler",
|
|
43
|
-
value: function htmlDropHandler(e) {
|
|
44
|
-
var files = e.dataTransfer.files;
|
|
45
|
-
for (var i = 0; i < files.length; i++) {
|
|
46
|
-
this.registerHtmlFile(files[i]);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Aspera drop handler
|
|
51
|
-
* @param {[type]} data [description]
|
|
52
|
-
* @return {[type]} [description]
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
}, {
|
|
56
|
-
key: "asperaDropHandler",
|
|
57
|
-
value: function asperaDropHandler(data) {
|
|
58
|
-
var that = this;
|
|
59
|
-
var files = data.files.dataTransfer.files;
|
|
60
|
-
if (!files.length) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
for (var i = 0; i < files.length; i++) {
|
|
64
|
-
this.registerAsperaFile(files[i]);
|
|
65
|
-
}
|
|
66
|
-
return Promise.all(this.export()).then(function (renamed) {
|
|
67
|
-
that.IngestUpload.uploadFiles(renamed, {}).then(function () {
|
|
68
|
-
that.map = {};
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Registers and HTML file drop
|
|
74
|
-
* @param {[type]} file [description]
|
|
75
|
-
* @return {[type]} [description]
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
}, {
|
|
79
|
-
key: "registerHtmlFile",
|
|
80
|
-
value: function registerHtmlFile(file) {
|
|
81
|
-
this.map[file.name] = file;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Registers and Aspera file drop
|
|
85
|
-
* @param {[type]} file [description]
|
|
86
|
-
* @return {[type]} [description]
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
}, {
|
|
90
|
-
key: "registerAsperaFile",
|
|
91
|
-
value: function registerAsperaFile(file) {
|
|
92
|
-
var basename = this.getBasename(file);
|
|
93
|
-
this.map[basename]["path"] = file.name;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Gets correct basename for MacOS and Windows
|
|
97
|
-
* @param {[type]} file [description]
|
|
98
|
-
* @return {[type]} [description]
|
|
99
|
-
*/
|
|
100
|
-
|
|
101
|
-
}, {
|
|
102
|
-
key: "getBasename",
|
|
103
|
-
value: function getBasename(file) {
|
|
104
|
-
return file.name[0] === "/" ? file.name.split("/").pop() : file.name.split("\\").pop();
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Renames and generates ingest record for internal filemap
|
|
108
|
-
* @return {[type]} [description]
|
|
109
|
-
*/
|
|
110
|
-
|
|
111
|
-
}, {
|
|
112
|
-
key: "export",
|
|
113
|
-
value: function _export() {
|
|
114
|
-
var that = this;
|
|
115
|
-
return Object.values(this.map).map(function (file) {
|
|
116
|
-
return that.rename(file);
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Renames the file and decorates it with ingest data using data from
|
|
121
|
-
* mediainfo and the Order
|
|
122
|
-
* @param {[type]} file [description]
|
|
123
|
-
* @return {[type]} [description]
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
|
-
}, {
|
|
127
|
-
key: "rename",
|
|
128
|
-
value: function rename(file) {
|
|
129
|
-
var that = this;
|
|
130
|
-
return this.Mediainfo.inform(file).then(function (meta) {
|
|
131
|
-
var order = void 0;
|
|
132
|
-
var asset = void 0;
|
|
133
|
-
var mediaType = file.type.split("/")[0];
|
|
134
|
-
|
|
135
|
-
var tags = _pixwelSdk.Ingest.mapMetaToTags(meta, mediaType);
|
|
136
|
-
|
|
137
|
-
if (!that.scope.workRequest) {
|
|
138
|
-
order = new _pixwelSdk.Order();
|
|
139
|
-
asset = new _pixwelSdk.Asset();
|
|
140
|
-
tags.Text = "txtd";
|
|
141
|
-
file.ingest = _pixwelSdk.Ingest.mapFromKnownData(that.scope.context, order, tags, that.scope.watermarks);
|
|
142
|
-
return file;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
order = new _pixwelSdk.Order(that.scope.workRequest);
|
|
146
|
-
asset = _pixwelSdk.Asset.mapFromOrder(order);
|
|
147
|
-
|
|
148
|
-
var options = {
|
|
149
|
-
tags: tags,
|
|
150
|
-
country: order.country,
|
|
151
|
-
language: order.language
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
if (that.scope.request && that.scope.request.tag) {
|
|
155
|
-
options.tags.Extra = [that.scope.request.tag.replace(" ", "-")];
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
options.tags.SubDub = {
|
|
159
|
-
sub: order.isSub(),
|
|
160
|
-
dub: order.isDub()
|
|
161
|
-
};
|
|
162
|
-
if (!order.isSub() && !order.isDub()) {
|
|
163
|
-
options.tags.Text = "txtd";
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
var basename = _pixwelSdk.Filename.render(that.scope.tags, that.scope.assetTypes, asset, options, mediaType);
|
|
167
|
-
var extension = file.name.split(".").pop();
|
|
168
|
-
file.renderedName = basename + "." + extension;
|
|
169
|
-
file.ingest = _pixwelSdk.Ingest.mapFromKnownData(that.scope.context, order, tags, that.scope.watermarks);
|
|
170
|
-
return file;
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
}]);
|
|
174
|
-
|
|
175
|
-
return IngestFileDrop;
|
|
176
|
-
}();
|
|
177
|
-
|
|
178
|
-
exports.default = IngestFileDrop;
|
package/src/IngestFileDrop.js
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { Asset, Filename, Order, Ingest, IngestFile } from "@pixwel/pixwel-sdk";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Collects file handles from HTML5, full paths from Aspera, inspects
|
|
5
|
-
* the dropped file using mediainfo, then renames the file according to
|
|
6
|
-
* the data from Mediainfo and the Order and submits it for upload.
|
|
7
|
-
* @type {Object}
|
|
8
|
-
*/
|
|
9
|
-
export default class IngestFileDrop {
|
|
10
|
-
/**
|
|
11
|
-
* Map that contains data from HTML5 file drop and Aspera file drop
|
|
12
|
-
* @type {Object}
|
|
13
|
-
*/
|
|
14
|
-
constructor(scope, Mediainfo, IngestUpload) {
|
|
15
|
-
this.map = {};
|
|
16
|
-
this.scope = scope;
|
|
17
|
-
this.IngestUpload = IngestUpload;
|
|
18
|
-
this.Mediainfo = Mediainfo;
|
|
19
|
-
this.asperaDropHandler = this.asperaDropHandler.bind(this);
|
|
20
|
-
this.htmlDropHandler = this.htmlDropHandler.bind(this);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* HTML file drop handler
|
|
24
|
-
* @param {[type]} e [description]
|
|
25
|
-
* @return {[type]} [description]
|
|
26
|
-
*/
|
|
27
|
-
htmlDropHandler(e) {
|
|
28
|
-
let files = e.dataTransfer.files;
|
|
29
|
-
for (var i = 0; i < files.length; i++) {
|
|
30
|
-
this.registerHtmlFile(files[i]);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Aspera drop handler
|
|
35
|
-
* @param {[type]} data [description]
|
|
36
|
-
* @return {[type]} [description]
|
|
37
|
-
*/
|
|
38
|
-
asperaDropHandler(data) {
|
|
39
|
-
var that = this;
|
|
40
|
-
let files = data.files.dataTransfer.files;
|
|
41
|
-
if (!files.length) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
for (var i = 0; i < files.length; i++) {
|
|
45
|
-
this.registerAsperaFile(files[i]);
|
|
46
|
-
}
|
|
47
|
-
return Promise.all(this.export()).then(renamed => {
|
|
48
|
-
that.IngestUpload.uploadFiles(renamed, {}).then(() => {
|
|
49
|
-
that.map = {};
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Registers and HTML file drop
|
|
55
|
-
* @param {[type]} file [description]
|
|
56
|
-
* @return {[type]} [description]
|
|
57
|
-
*/
|
|
58
|
-
registerHtmlFile(file) {
|
|
59
|
-
this.map[file.name] = file;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Registers and Aspera file drop
|
|
63
|
-
* @param {[type]} file [description]
|
|
64
|
-
* @return {[type]} [description]
|
|
65
|
-
*/
|
|
66
|
-
registerAsperaFile(file) {
|
|
67
|
-
let basename = this.getBasename(file);
|
|
68
|
-
this.map[basename]["path"] = file.name;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Gets correct basename for MacOS and Windows
|
|
72
|
-
* @param {[type]} file [description]
|
|
73
|
-
* @return {[type]} [description]
|
|
74
|
-
*/
|
|
75
|
-
getBasename(file) {
|
|
76
|
-
return file.name[0] === "/"
|
|
77
|
-
? file.name.split("/").pop()
|
|
78
|
-
: file.name.split("\\").pop();
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Renames and generates ingest record for internal filemap
|
|
82
|
-
* @return {[type]} [description]
|
|
83
|
-
*/
|
|
84
|
-
export() {
|
|
85
|
-
var that = this;
|
|
86
|
-
return Object.values(this.map).map(file => {
|
|
87
|
-
return that.rename(file);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Renames the file and decorates it with ingest data using data from
|
|
92
|
-
* mediainfo and the Order
|
|
93
|
-
* @param {[type]} file [description]
|
|
94
|
-
* @return {[type]} [description]
|
|
95
|
-
*/
|
|
96
|
-
rename(file) {
|
|
97
|
-
var that = this;
|
|
98
|
-
return this.Mediainfo.inform(file).then(meta => {
|
|
99
|
-
let order;
|
|
100
|
-
let asset;
|
|
101
|
-
let mediaType = file.type.split("/")[0];
|
|
102
|
-
|
|
103
|
-
let tags = Ingest.mapMetaToTags(meta, mediaType);
|
|
104
|
-
|
|
105
|
-
if (!that.scope.workRequest) {
|
|
106
|
-
order = new Order();
|
|
107
|
-
asset = new Asset();
|
|
108
|
-
tags.Text = "txtd";
|
|
109
|
-
file.ingest = Ingest.mapFromKnownData(
|
|
110
|
-
that.scope.context,
|
|
111
|
-
order,
|
|
112
|
-
tags,
|
|
113
|
-
that.scope.watermarks
|
|
114
|
-
);
|
|
115
|
-
return file;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
order = new Order(that.scope.workRequest);
|
|
119
|
-
asset = Asset.mapFromOrder(order);
|
|
120
|
-
|
|
121
|
-
let options = {
|
|
122
|
-
tags: tags,
|
|
123
|
-
country: order.country,
|
|
124
|
-
language: order.language
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
if (that.scope.request && that.scope.request.tag) {
|
|
128
|
-
options.tags.Extra = [that.scope.request.tag.replace(" ", "-")];
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
options.tags.SubDub = {
|
|
132
|
-
sub: order.isSub(),
|
|
133
|
-
dub: order.isDub()
|
|
134
|
-
};
|
|
135
|
-
if (!order.isSub() && !order.isDub()) {
|
|
136
|
-
options.tags.Text = "txtd";
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
let basename = Filename.render(
|
|
140
|
-
that.scope.tags,
|
|
141
|
-
that.scope.assetTypes,
|
|
142
|
-
asset,
|
|
143
|
-
options,
|
|
144
|
-
mediaType
|
|
145
|
-
);
|
|
146
|
-
let extension = file.name.split(".").pop();
|
|
147
|
-
file.renderedName = `${basename}.${extension}`;
|
|
148
|
-
file.ingest = Ingest.mapFromKnownData(
|
|
149
|
-
that.scope.context,
|
|
150
|
-
order,
|
|
151
|
-
tags,
|
|
152
|
-
that.scope.watermarks
|
|
153
|
-
);
|
|
154
|
-
return file;
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
}
|
package/src/docs.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"language":"javascript","client_name":"inchjs","args":[],"client_version":"0.4.1","git_repo_url":"git@github.com:Pixwel/platform.git","branch_name":"599-alt","objects":[{"comment":"","meta":{"range":[64,128],"filename":"Ass.js","lineno":4,"columnno":0,"path":"","code":{"id":"astnode100000010","name":"trim","type":"FunctionDeclaration","paramnames":["str"]}},"undocumented":true,"name":"trim","longname":"trim","kind":"function","scope":"global","params":[]},{"comment":"","meta":{"range":[130,410],"filename":"Ass.js","lineno":8,"columnno":0,"path":"","code":{"id":"astnode100000021","name":"searchIndex","type":"FunctionDeclaration","paramnames":["lines","pattern","startIndex"]},"vars":{"len":"searchIndex~len","startIndex":"searchIndex~startIndex","i":"searchIndex~i","line":"searchIndex~line"}},"undocumented":true,"name":"searchIndex","longname":"searchIndex","kind":"function","scope":"global","params":[]},{"comment":"","meta":{"range":[412,1818],"filename":"Ass.js","lineno":21,"columnno":0,"path":"","code":{"id":"astnode100000067","name":"extractStyles","type":"FunctionDeclaration","paramnames":["lines"]},"vars":{"line":"extractStyles~line","styles":"extractStyles~styles","currentIndex":"extractStyles~currentIndex","fields":"extractStyles~fields","nameIndex":"extractStyles~nameIndex","alignmentIndex":"extractStyles~alignmentIndex","pattern":"extractStyles~pattern","parts":"extractStyles~parts","style":"extractStyles~style","alignmentNumber":"extractStyles~alignmentNumber","style.alignment":"extractStyles~style.alignment","styles[undefined]":"extractStyles~styles.undefined]"}},"undocumented":true,"name":"extractStyles","longname":"extractStyles","kind":"function","scope":"global","params":[]},{"comment":"","meta":{"range":[1841,4468],"filename":"Ass.js","lineno":70,"columnno":4,"path":"","code":{"id":"astnode100000270","name":"parse","type":"FunctionExpression"},"vars":{"line":"module.exports.parse~line","currentIndex":"module.exports.parse~currentIndex","normalizeTime":"module.exports.parse~normalizeTime","normalizeText":"module.exports.parse~normalizeText","styles":"module.exports.parse~styles","fields":"module.exports.parse~fields","startIndex":"module.exports.parse~startIndex","endIndex":"module.exports.parse~endIndex","styleIndex":"module.exports.parse~styleIndex","textIndex":"module.exports.parse~textIndex","result":"module.exports.parse~result","pattern":"module.exports.parse~pattern","parts":"module.exports.parse~parts","entry":"module.exports.parse~entry","style":"module.exports.parse~style","entry.alignment":"module.exports.parse~entry.alignment"}},"undocumented":true,"name":"parse","longname":"module.exports.parse","kind":"function","memberof":"module.exports","scope":"static"},{"comment":"","meta":{"range":[4474,6251],"filename":"Ass.js","lineno":143,"columnno":4,"path":"","code":{"id":"astnode100000604","name":"export","type":"FunctionExpression"},"vars":{"result":"module.exports.export~result","options":"module.exports.export~options","font":"module.exports.export~font","normalizeTime":"module.exports.export~normalizeTime","normalizeText":"module.exports.export~normalizeText","":null}},"undocumented":true,"name":"export","longname":"module.exports.export","kind":"function","memberof":"module.exports","scope":"static"},{"comment":"","meta":{"range":[0,598],"filename":"Asset.js","lineno":1,"columnno":0,"path":"","code":{"id":"astnode100000842","name":"module.exports","type":"ClassDeclaration"}},"undocumented":true,"name":"exports","longname":"module.exports","kind":"class","memberof":"module","scope":"static"},{"comment":"","meta":{"range":[15,598],"filename":"Asset.js","lineno":1,"columnno":15,"path":"","code":{"id":"astnode100000843","name":"module.exports","type":"ClassDeclaration","paramnames":[]}},"undocumented":true,"name":"exports","longname":"module.exports","kind":"class","memberof":"module","scope":"static"},{"comment":"","meta":{"range":[33,596],"filename":"Asset.js","lineno":2,"columnno":4,"path":"","code":{"id":"astnode100000846","name":"mapFromOrder","type":"MethodDefinition","paramnames":["order"]},"vars":{"":null}},"undocumented":true,"name":"mapFromOrder","longname":"mapFromOrder","kind":"function","scope":"global","params":[]},{"comment":"/**\n* The Filename class parses a filename into tokens, and can also take a set of\n* tokens and create a valid Pixwel filename.\n* @type class\n*/","meta":{"range":[174,7418],"filename":"Filename.js","lineno":8,"columnno":0,"path":"","code":{"id":"astnode100000928","name":"module.exports","type":"ClassDeclaration"}},"undocumented":true,"name":"exports","longname":"module.exports","kind":"class","memberof":"module","scope":"static"},{"comment":"/**\n* The Filename class parses a filename into tokens, and can also take a set of\n* tokens and create a valid Pixwel filename.\n* @type class\n*/","meta":{"range":[189,7418],"filename":"Filename.js","lineno":8,"columnno":15,"path":"","code":{"id":"astnode100000929","name":"module.exports","type":"ClassDeclaration","paramnames":[]}},"classdesc":"The Filename class parses a filename into tokens, and can also take a set of\ntokens and create a valid Pixwel filename.","type":{"names":["class"]},"name":"exports","longname":"module.exports","kind":"class","memberof":"module","scope":"static"},{"comment":"/**\n* Renders a valid filename given all tags, all types, an asset, and metadata\n* options likely parsed from the file itself.\n* @param {Array} [allTags=[]] Collection of all known tags\n* @param {Array} [allTypes=[]] Collection of all known types\n* @param {Object} [asset={}] A Platform Asset\n* @param {Object} [options={}] options containing metadata about file\n* @return {String} A valid filename\n*/","meta":{"range":[680,7416],"filename":"Filename.js","lineno":18,"columnno":4,"path":"","code":{"id":"astnode100000932","name":"render","type":"MethodDefinition","paramnames":["allTags","allTypes","asset","options"]},"vars":{"":null}},"description":"Renders a valid filename given all tags, all types, an asset, and metadata\noptions likely parsed from the file itself.","params":[{"type":{"names":["Array"]},"optional":true,"defaultvalue":"[]","description":"Collection of all known tags","name":"allTags"},{"type":{"names":["Array"]},"optional":true,"defaultvalue":"[]","description":"Collection of all known types","name":"allTypes"},{"type":{"names":["Object"]},"optional":true,"defaultvalue":"{}","description":"A Platform Asset","name":"asset"},{"type":{"names":["Object"]},"optional":true,"defaultvalue":"{}","description":"options containing metadata about file","name":"options"}],"returns":[{"type":{"names":["String"]},"description":"A valid filename"}],"name":"render","longname":"render","kind":"function","scope":"global"},{"comment":"/**\n* [video description]\n* @type {[type]}\n*/","meta":{"range":[74,4621],"filename":"Ingest.js","lineno":7,"columnno":0,"path":"","code":{"id":"astnode100001807","name":"module.exports","type":"ClassDeclaration"}},"undocumented":true,"name":"exports","longname":"module.exports","kind":"class","memberof":"module","scope":"static"},{"comment":"/**\n* [video description]\n* @type {[type]}\n*/","meta":{"range":[89,4621],"filename":"Ingest.js","lineno":7,"columnno":15,"path":"","code":{"id":"astnode100001808","name":"module.exports","type":"ClassDeclaration","paramnames":[]}},"classdesc":"[video description]","name":"exports","longname":"module.exports","kind":"class","memberof":"module","scope":"static"},{"comment":"/**\n* [mapMetaToTags description]\n* @param {[type]} info [description]\n* @return {[type]} [description]\n*/","meta":{"range":[245,3023],"filename":"Ingest.js","lineno":13,"columnno":4,"path":"","code":{"id":"astnode100001811","name":"mapMetaToTags","type":"MethodDefinition","paramnames":["info"]},"vars":{"":null}},"description":"[mapMetaToTags description]","params":[{"name":"info"}],"returns":[{}],"name":"mapMetaToTags","longname":"mapMetaToTags","kind":"function","scope":"global"},{"comment":"","meta":{"range":[3028,4618],"filename":"Ingest.js","lineno":114,"columnno":4,"path":"","code":{"id":"astnode100002176","name":"mapFromOrder","type":"MethodDefinition","paramnames":["order","tags","watermarks"]},"vars":{"":null}},"undocumented":true,"name":"mapFromOrder","longname":"mapFromOrder","kind":"function","scope":"global","params":[]},{"comment":"","meta":{"range":[0,120],"filename":"IngestFile.js","lineno":1,"columnno":0,"path":"","code":{"id":"astnode100002336","name":"module.exports","type":"ClassDeclaration"}},"undocumented":true,"name":"exports","longname":"module.exports","kind":"class","memberof":"module","scope":"static"},{"comment":"","meta":{"range":[15,120],"filename":"IngestFile.js","lineno":1,"columnno":15,"path":"","code":{"id":"astnode100002337","name":"module.exports","type":"ClassDeclaration","paramnames":["file","order"]}},"undocumented":true,"name":"exports","longname":"module.exports","kind":"class","memberof":"module","scope":"static"},{"comment":"","meta":{"range":[35,84],"filename":"IngestFile.js","lineno":2,"columnno":1,"path":"","code":{"id":"astnode100002340","name":"module.exports","type":"MethodDefinition","paramnames":["file","order"]},"vars":{"":null}},"undocumented":true,"name":"exports","longname":"module.exports#module.exports","kind":"class","memberof":"module.exports#module","scope":"static","params":[]},{"comment":"/**\n* Collects file handles from HTML5, full paths from Aspera, inspects\n* the dropped file using mediainfo, then renames the file according to\n* the data from Mediainfo and the Order and submits it for upload.\n* @type {Object}\n*/","meta":{"range":[318,4278],"filename":"IngestFileDrop.js","lineno":9,"columnno":0,"path":"","code":{"id":"astnode100002366","name":"module.exports","type":"ClassDeclaration"}},"undocumented":true,"name":"exports","longname":"module.exports","kind":"class","memberof":"module","scope":"static"},{"comment":"/**\n* Collects file handles from HTML5, full paths from Aspera, inspects\n* the dropped file using mediainfo, then renames the file according to\n* the data from Mediainfo and the Order and submits it for upload.\n* @type {Object}\n*/","meta":{"range":[333,4278],"filename":"IngestFileDrop.js","lineno":9,"columnno":15,"path":"","code":{"id":"astnode100002367","name":"module.exports","type":"ClassDeclaration","paramnames":["scope","Mediainfo","IngestUpload"]}},"classdesc":"Collects file handles from HTML5, full paths from Aspera, inspects\nthe dropped file using mediainfo, then renames the file according to\nthe data from Mediainfo and the Order and submits it for upload.","type":{"names":["Object"]},"name":"exports","longname":"module.exports","kind":"class","memberof":"module","scope":"static","description":"Map that contains data from HTML5 file drop and Aspera file drop","params":[]},{"comment":"/**\n* Map that contains data from HTML5 file drop and Aspera file drop\n* @type {Object}\n*/","meta":{"range":[470,810],"filename":"IngestFileDrop.js","lineno":14,"columnno":4,"path":"","code":{"id":"astnode100002370","name":"module.exports","type":"MethodDefinition","paramnames":["scope","Mediainfo","IngestUpload"]},"vars":{"":null}},"description":"Map that contains data from HTML5 file drop and Aspera file drop","type":{"names":["Object"]},"name":"exports","longname":"module.exports#module.exports","kind":"class","memberof":"module.exports#module","scope":"static","params":[],"undocumented":true},{"comment":"/**\n* HTML file drop handler\n* @param {[type]} e [description]\n* @return {[type]} [description]\n*/","meta":{"range":[961,1153],"filename":"IngestFileDrop.js","lineno":27,"columnno":4,"path":"","code":{"id":"astnode100002425","name":"htmlDropHandler","type":"MethodDefinition","paramnames":["e"]},"vars":{"":null}},"description":"HTML file drop handler","params":[{"name":"e"}],"returns":[{}],"name":"htmlDropHandler","longname":"htmlDropHandler","kind":"function","scope":"global"},{"comment":"/**\n* Aspera drop handler\n* @param {[type]} data [description]\n* @return {[type]} [description]\n*/","meta":{"range":[1307,1815],"filename":"IngestFileDrop.js","lineno":38,"columnno":4,"path":"","code":{"id":"astnode100002459","name":"asperaDropHandler","type":"MethodDefinition","paramnames":["data"]},"vars":{"":null}},"description":"Aspera drop handler","params":[{"name":"data"}],"returns":[{}],"name":"asperaDropHandler","longname":"asperaDropHandler","kind":"function","scope":"global"},{"comment":"/**\n* Registers and HTML file drop\n* @param {[type]} file [description]\n* @return {[type]} [description]\n*/","meta":{"range":[1978,2052],"filename":"IngestFileDrop.js","lineno":58,"columnno":4,"path":"","code":{"id":"astnode100002535","name":"registerHtmlFile","type":"MethodDefinition","paramnames":["file"]},"vars":{"":null}},"description":"Registers and HTML file drop","params":[{"name":"file"}],"returns":[{}],"name":"registerHtmlFile","longname":"registerHtmlFile","kind":"function","scope":"global"},{"comment":"/**\n* Registers and Aspera file drop\n* @param {[type]} file [description]\n* @return {[type]} [description]\n*/","meta":{"range":[2217,2356],"filename":"IngestFileDrop.js","lineno":66,"columnno":4,"path":"","code":{"id":"astnode100002550","name":"registerAsperaFile","type":"MethodDefinition","paramnames":["file"]},"vars":{"":null}},"description":"Registers and Aspera file drop","params":[{"name":"file"}],"returns":[{}],"name":"registerAsperaFile","longname":"registerAsperaFile","kind":"function","scope":"global"},{"comment":"/**\n* Gets correct basename for MacOS and Windows\n* @param {[type]} file [description]\n* @return {[type]} [description]\n*/","meta":{"range":[2534,2665],"filename":"IngestFileDrop.js","lineno":75,"columnno":4,"path":"","code":{"id":"astnode100002575","name":"getBasename","type":"MethodDefinition","paramnames":["file"]},"vars":{"":null}},"description":"Gets correct basename for MacOS and Windows","params":[{"name":"file"}],"returns":[{}],"name":"getBasename","longname":"getBasename","kind":"function","scope":"global"},{"comment":"/**\n* Renames and generates ingest record for internal filemap\n* @return {[type]} [description]\n*/","meta":{"range":[2804,2948],"filename":"IngestFileDrop.js","lineno":82,"columnno":4,"path":"","code":{"id":"astnode100002609","name":"export","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"description":"Renames and generates ingest record for internal filemap","returns":[{}],"name":"export","longname":"export","kind":"function","scope":"global","params":[]},{"comment":"/**\n* Renames the file and decorates it with ingest data using data from\n* mediainfo and the Order\n* @param {[type]} file [description]\n* @return {[type]} [description]\n*/","meta":{"range":[3160,4276],"filename":"IngestFileDrop.js","lineno":94,"columnno":4,"path":"","code":{"id":"astnode100002637","name":"rename","type":"MethodDefinition","paramnames":["file"]},"vars":{"":null}},"description":"Renames the file and decorates it with ingest data using data from\nmediainfo and the Order","params":[{"name":"file"}],"returns":[{}],"name":"rename","longname":"rename","kind":"function","scope":"global"},{"comment":"","meta":{"range":[63,589],"filename":"Order.js","lineno":4,"columnno":0,"path":"","code":{"id":"astnode100002819","name":"module.exports","type":"ClassDeclaration"}},"undocumented":true,"name":"exports","longname":"module.exports","kind":"class","memberof":"module","scope":"static"},{"comment":"","meta":{"range":[78,589],"filename":"Order.js","lineno":4,"columnno":15,"path":"","code":{"id":"astnode100002820","name":"module.exports","type":"ClassDeclaration","paramnames":["data"]}},"undocumented":true,"name":"exports","longname":"module.exports","kind":"class","memberof":"module","scope":"static"},{"comment":"","meta":{"range":[96,379],"filename":"Order.js","lineno":5,"columnno":4,"path":"","code":{"id":"astnode100002823","name":"module.exports","type":"MethodDefinition","paramnames":["data"]},"vars":{"":null}},"undocumented":true,"name":"exports","longname":"module.exports#module.exports","kind":"class","memberof":"module.exports#module","scope":"static","params":[]},{"comment":"","meta":{"range":[384,489],"filename":"Order.js","lineno":17,"columnno":4,"path":"","code":{"id":"astnode100002854","name":"isDub","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"undocumented":true,"name":"isDub","longname":"isDub","kind":"function","scope":"global","params":[]},{"comment":"","meta":{"range":[494,587],"filename":"Order.js","lineno":20,"columnno":4,"path":"","code":{"id":"astnode100002874","name":"isSub","type":"MethodDefinition","paramnames":[]},"vars":{"":null}},"undocumented":true,"name":"isSub","longname":"isSub","kind":"function","scope":"global","params":[]},{"comment":"","meta":{"range":[64,482],"filename":"Srt.js","lineno":4,"columnno":0,"path":"","code":{"id":"astnode100002904","name":"stripTags","type":"FunctionDeclaration","paramnames":["input","allowed"]},"vars":{"allowed":"stripTags~allowed","tags":"stripTags~tags","commentsAndPhpTags":"stripTags~commentsAndPhpTags","":null}},"undocumented":true,"name":"stripTags","longname":"stripTags","kind":"function","scope":"global","params":[]},{"comment":"","meta":{"range":[608,1980],"filename":"Srt.js","lineno":19,"columnno":4,"path":"","code":{"id":"astnode100002987","name":"parse","type":"FunctionExpression"},"vars":{"result":"module.exports.parse~result","state":"module.exports.parse~state","subText":"module.exports.parse~subText","subTime":"module.exports.parse~subTime","time":"module.exports.parse~time","":null}},"undocumented":true,"name":"parse","longname":"module.exports.parse","kind":"function","memberof":"module.exports","scope":"static"},{"comment":"","meta":{"range":[1986,2787],"filename":"Srt.js","lineno":67,"columnno":4,"path":"","code":{"id":"astnode100003129","name":"export","type":"FunctionExpression"},"vars":{"result":"module.exports.export~result","i":"module.exports.export~i","":null}},"undocumented":true,"name":"export","longname":"module.exports.export","kind":"function","memberof":"module.exports","scope":"static"},{"comment":"","meta":{"range":[21,1005],"filename":"Sub.js","lineno":2,"columnno":4,"path":"","code":{"id":"astnode100003215","name":"parse","type":"FunctionExpression"},"vars":{"result":"module.exports.parse~result","current":"module.exports.parse~current","":null}},"undocumented":true,"name":"parse","longname":"module.exports.parse","kind":"function","memberof":"module.exports","scope":"static"},{"comment":"","meta":{"range":[78,155],"filename":"TimeFormat.js","lineno":4,"columnno":4,"path":"","code":{"id":"astnode100003336","name":"isValidTime","type":"FunctionExpression"}},"undocumented":true,"name":"isValidTime","longname":"module.exports.isValidTime","kind":"function","memberof":"module.exports","scope":"static"},{"comment":"","meta":{"range":[161,566],"filename":"TimeFormat.js","lineno":7,"columnno":4,"path":"","code":{"id":"astnode100003348","name":"timeToTimestamp","type":"FunctionExpression"},"vars":{"match":"module.exports.timeToTimestamp~match","precision":"module.exports.timeToTimestamp~precision"}},"undocumented":true,"name":"timeToTimestamp","longname":"module.exports.timeToTimestamp","kind":"function","memberof":"module.exports","scope":"static"},{"comment":"","meta":{"range":[572,956],"filename":"TimeFormat.js","lineno":20,"columnno":4,"path":"","code":{"id":"astnode100003415","name":"timestampToTime","type":"FunctionExpression"},"vars":{"hours":"module.exports.timestampToTime~hours","min":"module.exports.timestampToTime~min","sec":"module.exports.timestampToTime~sec","fixedSec":"module.exports.timestampToTime~fixedSec"}},"undocumented":true,"name":"timestampToTime","longname":"module.exports.timestampToTime","kind":"function","memberof":"module.exports","scope":"static"},{"comment":"","meta":{"range":[962,1185],"filename":"TimeFormat.js","lineno":27,"columnno":4,"path":"","code":{"id":"astnode100003491","name":"timeDiff","type":"FunctionExpression"}},"undocumented":true,"name":"timeDiff","longname":"module.exports.timeDiff","kind":"function","memberof":"module.exports","scope":"static"},{"comment":"","meta":{"range":[1191,1449],"filename":"TimeFormat.js","lineno":33,"columnno":4,"path":"","code":{"id":"astnode100003522","name":"timestampDiff","type":"FunctionExpression"},"vars":{"diff":"module.exports.timestampDiff~diff"}},"undocumented":true,"name":"timestampDiff","longname":"module.exports.timestampDiff","kind":"function","memberof":"module.exports","scope":"static"},{"comment":"","meta":{"range":[1455,1621],"filename":"TimeFormat.js","lineno":40,"columnno":4,"path":"","code":{"id":"astnode100003569","name":"startTime","type":"FunctionExpression"},"vars":{"timestamp":"module.exports.startTime~timestamp"}},"undocumented":true,"name":"startTime","longname":"module.exports.startTime","kind":"function","memberof":"module.exports","scope":"static"},{"comment":"","meta":{"range":[1627,1792],"filename":"TimeFormat.js","lineno":44,"columnno":4,"path":"","code":{"id":"astnode100003595","name":"stopTime","type":"FunctionExpression"},"vars":{"timestamp":"module.exports.stopTime~timestamp"}},"undocumented":true,"name":"stopTime","longname":"module.exports.stopTime","kind":"function","memberof":"module.exports","scope":"static"}]}
|