♻ Refactor files returned by solidpkg reader^

This commit is contained in:
C-3PO 2018-06-22 17:38:53 +02:00
parent 06762c6107
commit 07caf282d8
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
2 changed files with 2 additions and 2 deletions

View file

@ -10,5 +10,5 @@ import getSolidpkg from './ssn/getSolidpkg';
//----- SOLIDPKG ----- //----- SOLIDPKG -----
//.solidpkg files contain a single Bencode file called "metafile.solid" //.solidpkg files contain a single Bencode file called "metafile.solid"
const solidFile = await getSolidpkg('assets_swtor_de_de', -1, 0); const solidFile = await getSolidpkg('assets_swtor_de_de', -1, 0);
console.log(solidFile.files); console.log(solidFile);
})(); })();

View file

@ -46,7 +46,7 @@ export default async function getSolidpkg(product: Product, from: number, to: nu
return { return {
created: new Date(solidContents['creation date'] * 1000), created: new Date(solidContents['creation date'] * 1000),
files: solidContents.info.files, files: solidContents.info.files.map(({ length, path: [name] }) => ({ name, length })),
pieceLength: solidContents.info['piece length'], pieceLength: solidContents.info['piece length'],
//pieces: solidContents.info.pieces, //pieces: solidContents.info.pieces,
}; };