From 42db8d36a60651e87548c8431bdaf94ee2823139 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Sun, 24 Jun 2018 02:24:13 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Allow=20reliable-id=20to=20be=20?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/interfaces/ISolidFile.ts | 6 +++--- src/ssn/verifySolidpkg.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/interfaces/ISolidFile.ts b/src/interfaces/ISolidFile.ts index fe6fbe8..45a3a81 100644 --- a/src/interfaces/ISolidFile.ts +++ b/src/interfaces/ISolidFile.ts @@ -28,11 +28,11 @@ interface ISolid { /** Title of this torrent in the format `${product}: ${from}to${to}` */ title: string; /** Unknown integer, always 16097. */ - networkgroupid: number; + networkgroupid: 16097; /** The URL where the files from this torrent are stored, in the format `http://cdn-patch.swtor.com/patch/${product}/${product}_${from}to${to}/` */ reliable: string; - /** Always '0' */ - 'reliable-id': string; + /** Always '0' or '1' */ + 'reliable-id': '0' | '1'; /** Contains further information about this torrent, including the list of files. */ info: ISolidFileInfo; } diff --git a/src/ssn/verifySolidpkg.ts b/src/ssn/verifySolidpkg.ts index 3006beb..96f179f 100644 --- a/src/ssn/verifySolidpkg.ts +++ b/src/ssn/verifySolidpkg.ts @@ -17,8 +17,8 @@ export default function verifySolidpkg(file: ISolid, { product, from, to }: {pro if (file.reliable !== `http://cdn-patch.swtor.com/patch/${product}/${product}_${from}to${to}/`) { throw new Error(`Expected reliable URL but it was "${file.reliable}".`); } - if (file['reliable-id'] !== '0') { - throw new Error(`Expected reliable-id to be "0" but it was "${file['reliable-id']}".`); + if (file['reliable-id'] !== '0' && file['reliable-id'] !== '1') { + throw new Error(`Expected reliable-id to be "0" or "1" but it was "${file['reliable-id']}".`); } if (file.info === undefined) {