♻ Refactor files returned by solidpkg reader^
This commit is contained in:
parent
06762c6107
commit
07caf282d8
2 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -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,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue