🐛 Allow reliable-id to be 1

This commit is contained in:
C-3PO 2018-06-24 02:24:13 +02:00
parent 52157f544c
commit 42db8d36a6
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
2 changed files with 5 additions and 5 deletions

View file

@ -28,11 +28,11 @@ interface ISolid {
/** Title of this torrent in the format `${product}: ${from}to${to}` */ /** Title of this torrent in the format `${product}: ${from}to${to}` */
title: string; title: string;
/** Unknown integer, always 16097. */ /** 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}/` */ /** 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; reliable: string;
/** Always '0' */ /** Always '0' or '1' */
'reliable-id': string; 'reliable-id': '0' | '1';
/** Contains further information about this torrent, including the list of files. */ /** Contains further information about this torrent, including the list of files. */
info: ISolidFileInfo; info: ISolidFileInfo;
} }

View file

@ -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}/`) { 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}".`); throw new Error(`Expected reliable URL but it was "${file.reliable}".`);
} }
if (file['reliable-id'] !== '0') { if (file['reliable-id'] !== '0' && file['reliable-id'] !== '1') {
throw new Error(`Expected reliable-id to be "0" but it was "${file['reliable-id']}".`); throw new Error(`Expected reliable-id to be "0" or "1" but it was "${file['reliable-id']}".`);
} }
if (file.info === undefined) { if (file.info === undefined) {