Commit db45d968 authored by wudizhanche1000's avatar wudizhanche1000

ygopro特殊路径

parent b7ea0516
......@@ -13,7 +13,7 @@ const Aria2 = require('aria2');
@Injectable()
export class DownloadService {
aria2 = new Aria2();
baseURL = 'http://thief.mycard.moe/metalinks/'
baseURL = 'http://thief.mycard.moe/metalinks/';
appGidMap = new Map<App,string>();
gidAppMap = new Map<string,App>();
eventEmitter = new EventEmitter();
......@@ -106,6 +106,9 @@ export class DownloadService {
return app;
} else {
let meta4link = `${this.baseURL}${id}.meta4`;
if (id === "ygopro") {
meta4link = `${this.baseURL}${id}-${process.platform}.meta4`
}
let response = await this.http.get(meta4link).toPromise();
let meta4 = btoa(response.text());
let gid = (await this.aria2.addMetalink(meta4, {dir: path}))[0];
......
......@@ -121,7 +121,11 @@ export class InstallService {
}
async getChecksumFile(app: App): Promise<Map<string,string> > {
let checksumMap: Map<string,string> = await this.http.get(this.checksumUri + app.id)
let checksumUrl = this.checksumUri + app.id;
if (app.id === "ygopro") {
checksumUrl = this.checksumUri + app.id + "-" + process.platform;
}
let checksumMap: Map<string,string> = await this.http.get(checksumUrl)
.map((response)=> {
let map = new Map<string,string>();
for (let line of response.text().split('\n')) {
......@@ -144,6 +148,9 @@ export class InstallService {
let options = this.installQueue.get(app);
let checksumMap = await this.getChecksumFile(app);
let packagePath = path.join(options.installLibrary, 'downloading', `${app.id}.tar.xz`);
if (app.id === "ygopro") {
packagePath = path.join(options.installLibrary, 'downloading', `${app.id}-${process.platform}.tar.xz`);
}
let destPath: string;
if (app.parent) {
let differenceSet = new Set<string>();
......
......@@ -217,9 +217,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th07"
],
"darwin": [
"wine"
"wine",
"th07"
]
},
"references": {
......@@ -336,9 +339,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th075"
],
"darwin": [
"wine"
"wine",
"th075"
]
},
"references": {
......@@ -455,9 +461,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th08"
],
"darwin": [
"wine"
"wine",
"th08"
]
},
"references": {
......@@ -574,9 +583,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th09"
],
"darwin": [
"wine"
"wine",
"th09"
]
},
"references": {
......@@ -693,9 +705,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th095"
],
"darwin": [
"wine"
"wine",
"th095"
]
},
"references": {
......@@ -812,9 +827,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th1"
],
"darwin": [
"wine"
"wine",
"th1"
]
},
"references": {
......@@ -931,9 +949,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th10"
],
"darwin": [
"wine"
"wine",
"th10"
]
},
"references": {
......@@ -1050,9 +1071,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th105"
],
"darwin": [
"wine"
"wine",
"th105"
]
},
"references": {
......@@ -1169,9 +1193,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th11"
],
"darwin": [
"wine"
"wine",
"th11"
]
},
"references": {
......@@ -1288,9 +1315,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th12"
],
"darwin": [
"wine"
"wine",
"th12"
]
},
"references": {
......@@ -1421,9 +1451,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th123"
],
"darwin": [
"wine"
"wine",
"th123"
]
},
"references": {
......@@ -1540,9 +1573,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th2"
],
"darwin": [
"wine"
"wine",
"th2"
]
},
"references": {
......@@ -1659,9 +1695,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th3"
],
"darwin": [
"wine"
"wine",
"th3"
]
},
"references": {
......@@ -1778,9 +1817,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th4"
],
"darwin": [
"wine"
"wine",
"th4"
]
},
"references": {
......@@ -1897,9 +1939,12 @@
"language"
],
"dependencies": {
"win32": [],
"win32": [
"th5"
],
"darwin": [
"wine"
"wine",
"th5"
]
},
"references": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment