Commit db45d968 authored by wudizhanche1000's avatar wudizhanche1000

ygopro特殊路径

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