Skip to content

Commit

Permalink
Merge 9e0ab04 into 12bbe4f
Browse files Browse the repository at this point in the history
  • Loading branch information
kuu committed Jul 28, 2019
2 parents 12bbe4f + 9e0ab04 commit 5e026cd
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion file.js
Expand Up @@ -15,7 +15,7 @@ function storeData({uri, data}, rootPath) {
let localPath;

if (path.isAbsolute(uri)) {
localPath = path.join(rootPath, path.relative(rootPath, uri));
localPath = path.join(rootPath, uri);
} else {
const obj = tryCatch(
() => new URL(uri),
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -51,7 +51,7 @@
"dependencies": {
"debug": "^4.1.1",
"hls-parser": "^0.4.4",
"hlx-util": "0.0.2"
"hlx-util": "0.0.3"
},
"devDependencies": {
"ava": "^2.2.0",
Expand Down
4 changes: 2 additions & 2 deletions test/spec/file.spec.js
Expand Up @@ -56,9 +56,9 @@ test.cb('file.storeData.Buffer.path', t => {
const {storeData} = proxyquire('../../file', {fs: mockFs});
const spyWriteFile = sinon.spy(mockFs, 'writeFile');

storeData({uri: '/abc/def/ghi/jkl.mp4', data: Buffer.alloc(10)}, '/abc/def/')
storeData({uri: '/abc/def/ghi/jkl.mp4', data: Buffer.alloc(10)}, '/path/to/')
.then(destPath => {
t.is(destPath, '/abc/def/ghi/jkl.mp4');
t.is(destPath, '/path/to/abc/def/ghi/jkl.mp4');
t.is(spyWriteFile.callCount, 1);
t.end();
});
Expand Down
50 changes: 25 additions & 25 deletions test/spec/writable.spec.js
Expand Up @@ -32,65 +32,65 @@ class MockReadStream extends stream.Readable {
data = HLS.parse(`
#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=1280000,AVERAGE-BANDWIDTH=1000000,CODECS="avc1.640029,mp4a.40.2"
http://example.com/low.m3u8
/media.example.com/low.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2560000,AVERAGE-BANDWIDTH=2000000,CODECS="avc1.640029,mp4a.40.2"
http://example.com/mid.m3u8
/media.example.com/mid.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=7680000,AVERAGE-BANDWIDTH=6000000,CODECS="avc1.640029,mp4a.40.2"
http://example.com/high.m3u8
/media.example.com/high.m3u8
`);
data.uri = 'http://example.com/master.m3u8';
data.uri = '/media.example.com/master.m3u8';
this.push(data);
data = HLS.parse(`
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXTINF:9.009,
http://media.example.com/low/01.ts
/media.example.com/low/01.ts
#EXTINF:9.009,
http://media.example.com/low/02.ts
/media.example.com/low/02.ts
#EXTINF:3.003,
http://media.example.com/low/03.ts
/media.example.com/low/03.ts
#EXT-X-ENDLIST
`);
data.uri = 'http://example.com/low.m3u8';
data.uri = '/media.example.com/low.m3u8';
this.push(data);
this.push(createSegment('http://media.example.com/low/01.ts'));
this.push(createSegment('http://media.example.com/low/02.ts'));
this.push(createSegment('http://media.example.com/low/03.ts'));
this.push(createSegment('/media.example.com/low/01.ts'));
this.push(createSegment('/media.example.com/low/02.ts'));
this.push(createSegment('/media.example.com/low/03.ts'));
data = HLS.parse(`
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXTINF:9.009,
http://media.example.com/mid/01.ts
/media.example.com/mid/01.ts
#EXTINF:9.009,
http://media.example.com/mid/02.ts
/media.example.com/mid/02.ts
#EXTINF:3.003,
http://media.example.com/mid/03.ts
/media.example.com/mid/03.ts
#EXT-X-ENDLIST
`);
data.uri = 'http://example.com/mid.m3u8';
data.uri = '/media.example.com/mid.m3u8';
this.push(data);
this.push(createSegment('http://media.example.com/mid/01.ts'));
this.push(createSegment('http://media.example.com/mid/02.ts'));
this.push(createSegment('http://media.example.com/mid/03.ts'));
this.push(createSegment('/media.example.com/mid/01.ts'));
this.push(createSegment('/media.example.com/mid/02.ts'));
this.push(createSegment('/media.example.com/mid/03.ts'));
data = HLS.parse(`
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXTINF:9.009,
http://media.example.com/high/01.ts
/media.example.com/high/01.ts
#EXTINF:9.009,
http://media.example.com/high/02.ts
/media.example.com/high/02.ts
#EXTINF:3.003,
http://media.example.com/high/03.ts
/media.example.com/high/03.ts
#EXT-X-ENDLIST
`);
data.uri = 'http://example.com/high.m3u8';
data.uri = '/media.example.com/high.m3u8';
this.push(data);
this.push(createSegment('http://media.example.com/high/01.ts'));
this.push(createSegment('http://media.example.com/high/02.ts'));
this.push(createSegment('http://media.example.com/high/03.ts'));
this.push(createSegment('/media.example.com/high/01.ts'));
this.push(createSegment('/media.example.com/high/02.ts'));
this.push(createSegment('/media.example.com/high/03.ts'));
this.push(null);
this.consumed = true;
}
Expand Down

0 comments on commit 5e026cd

Please sign in to comment.