From 07caf282d8db1332597e5816689849be4439a08c Mon Sep 17 00:00:00 2001 From: C-3PO Date: Fri, 22 Jun 2018 17:38:53 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=20Refactor=20files=20returned=20by=20?= =?UTF-8?q?solidpkg=20reader^?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/installPatch.ts | 2 +- src/ssn/getSolidpkg.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/installPatch.ts b/src/installPatch.ts index 34c4638..bb1e084 100644 --- a/src/installPatch.ts +++ b/src/installPatch.ts @@ -10,5 +10,5 @@ import getSolidpkg from './ssn/getSolidpkg'; //----- SOLIDPKG ----- //.solidpkg files contain a single Bencode file called "metafile.solid" const solidFile = await getSolidpkg('assets_swtor_de_de', -1, 0); - console.log(solidFile.files); + console.log(solidFile); })(); diff --git a/src/ssn/getSolidpkg.ts b/src/ssn/getSolidpkg.ts index 7bf080d..75f536b 100644 --- a/src/ssn/getSolidpkg.ts +++ b/src/ssn/getSolidpkg.ts @@ -46,7 +46,7 @@ export default async function getSolidpkg(product: Product, from: number, to: nu return { 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'], //pieces: solidContents.info.pieces, };