Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
moecube
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
JoyJ
moecube
Commits
51141dfe
Commit
51141dfe
authored
Dec 14, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ygopro update
parent
63f153b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
59 deletions
+29
-59
app/app-detail.component.html
app/app-detail.component.html
+1
-0
app/app.ts
app/app.ts
+3
-0
app/apps.service.ts
app/apps.service.ts
+23
-7
apps.json
apps.json
+2
-52
No files found.
app/app-detail.component.html
View file @
51141dfe
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<span
i18n
*ngIf=
"currentApp.isInstalling()"
>
正在安装...
</span>
<span
i18n
*ngIf=
"currentApp.isInstalling()"
>
正在安装...
</span>
<span
i18n
*ngIf=
"currentApp.isUninstalling()"
>
正在卸载...
</span>
<span
i18n
*ngIf=
"currentApp.isUninstalling()"
>
正在卸载...
</span>
<span
i18n
*ngIf=
"currentApp.isWaiting()"
>
等待安装...
</span>
<span
i18n
*ngIf=
"currentApp.isWaiting()"
>
等待安装...
</span>
<span
i18n
*ngIf=
"currentApp.isUpdating()"
>
正在更新...
</span>
<span
*ngIf=
"currentApp.status.total"
>
{{(currentApp.status.progress/currentApp.status.total * 100).toFixed()}}%
</span>
<span
*ngIf=
"currentApp.status.total"
>
{{(currentApp.status.progress/currentApp.status.total * 100).toFixed()}}%
</span>
<span>
{{currentApp.progressMessage()}}
</span>
<span>
{{currentApp.progressMessage()}}
</span>
</div>
</div>
...
...
app/app.ts
View file @
51141dfe
...
@@ -114,6 +114,9 @@ export class App {
...
@@ -114,6 +114,9 @@ export class App {
isUninstalling
():
boolean
{
isUninstalling
():
boolean
{
return
this
.
status
.
status
===
"
uninstalling
"
;
return
this
.
status
.
status
===
"
uninstalling
"
;
}
}
isUpdating
():
boolean
{
return
this
.
status
.
status
===
"
updating
"
;
}
runnable
():
boolean
{
runnable
():
boolean
{
return
[
Category
.
game
].
includes
(
this
.
category
);
return
[
Category
.
game
].
includes
(
this
.
category
);
...
...
app/apps.service.ts
View file @
51141dfe
...
@@ -4,6 +4,7 @@ import * as crypto from "crypto";
...
@@ -4,6 +4,7 @@ import * as crypto from "crypto";
import
{
App
,
AppStatus
,
Action
}
from
"
./app
"
;
import
{
App
,
AppStatus
,
Action
}
from
"
./app
"
;
import
{
SettingsService
}
from
"
./settings.sevices
"
;
import
{
SettingsService
}
from
"
./settings.sevices
"
;
import
*
as
fs
from
"
fs
"
;
import
*
as
fs
from
"
fs
"
;
import
{
createReadStream
,
createWriteStream
}
from
"
fs
"
;
import
*
as
path
from
"
path
"
;
import
*
as
path
from
"
path
"
;
import
*
as
child_process
from
"
child_process
"
;
import
*
as
child_process
from
"
child_process
"
;
import
{
ChildProcess
}
from
"
child_process
"
;
import
{
ChildProcess
}
from
"
child_process
"
;
...
@@ -19,8 +20,6 @@ import {Observable, Observer} from "rxjs/Rx";
...
@@ -19,8 +20,6 @@ import {Observable, Observer} from "rxjs/Rx";
import
Timer
=
NodeJS
.
Timer
;
import
Timer
=
NodeJS
.
Timer
;
// import mkdirp = require("mkdirp");
// import mkdirp = require("mkdirp");
import
ReadableStream
=
NodeJS
.
ReadableStream
;
import
ReadableStream
=
NodeJS
.
ReadableStream
;
import
{
createReadStream
}
from
"
fs
"
;
import
{
createWriteStream
}
from
"
fs
"
;
const
Aria2
=
require
(
'
aria2
'
);
const
Aria2
=
require
(
'
aria2
'
);
const
sudo
=
require
(
'
electron-sudo
'
);
const
sudo
=
require
(
'
electron-sudo
'
);
...
@@ -506,7 +505,13 @@ export class AppsService {
...
@@ -506,7 +505,13 @@ export class AppsService {
if
(
changedFiles
&&
changedFiles
.
size
>
0
)
{
if
(
changedFiles
&&
changedFiles
.
size
>
0
)
{
Logger
.
info
(
"
Update changed files:
"
,
changedFiles
);
Logger
.
info
(
"
Update changed files:
"
,
changedFiles
);
let
updateUrl
=
updateServer
+
app
.
id
;
let
updateUrl
=
updateServer
+
app
.
id
;
if
(
app
.
id
===
"
ygopro
"
||
app
.
id
===
"
desmume
"
)
{
if
(
app
.
id
===
"
ygopro
"
)
{
let
locale
=
this
.
settingsService
.
getLocale
();
if
(
!
[
'
zh-CN
'
,
'
en-US
'
,
'
ja-JP
'
].
includes
(
locale
))
{
locale
=
'
en-US
'
;
}
updateUrl
=
updateUrl
+
'
-
'
+
process
.
platform
+
'
-
'
+
locale
;
}
else
if
(
app
.
id
===
"
desmume
"
)
{
updateUrl
=
updateUrl
+
'
-
'
+
process
.
platform
;
updateUrl
=
updateUrl
+
'
-
'
+
process
.
platform
;
}
}
let
metalink
=
await
this
.
http
.
post
(
updateUrl
,
changedFiles
).
map
((
response
)
=>
response
.
text
()).
toPromise
();
let
metalink
=
await
this
.
http
.
post
(
updateUrl
,
changedFiles
).
map
((
response
)
=>
response
.
text
()).
toPromise
();
...
@@ -559,9 +564,12 @@ export class AppsService {
...
@@ -559,9 +564,12 @@ export class AppsService {
const
addDownloadTask
=
async
(
app
:
App
,
dir
:
string
):
Promise
<
{
app
:
App
,
files
:
string
[]}
>
=>
{
const
addDownloadTask
=
async
(
app
:
App
,
dir
:
string
):
Promise
<
{
app
:
App
,
files
:
string
[]}
>
=>
{
let
metalinkUrl
=
app
.
download
;
let
metalinkUrl
=
app
.
download
;
if
(
app
.
id
===
"
ygopro
"
)
{
if
(
app
.
id
===
"
ygopro
"
)
{
metalinkUrl
=
"
https://thief.mycard.moe/metalinks/ygopro-
"
+
process
.
platform
+
"
.meta4
"
;
let
locale
=
this
.
settingsService
.
getLocale
();
}
if
(
!
[
'
zh-CN
'
,
'
en-US
'
,
'
ja-JP
'
].
includes
(
locale
))
{
if
(
app
.
id
===
"
desmume
"
)
{
locale
=
'
en-US
'
;
}
metalinkUrl
=
"
https://thief.mycard.moe/metalinks/ygopro-
"
+
process
.
platform
+
'
-
'
+
locale
+
"
.meta4
"
;
}
else
if
(
app
.
id
===
"
desmume
"
)
{
metalinkUrl
=
"
https://thief.mycard.moe/metalinks/desmume-
"
+
process
.
platform
+
"
.meta4
"
;
metalinkUrl
=
"
https://thief.mycard.moe/metalinks/desmume-
"
+
process
.
platform
+
"
.meta4
"
;
}
}
app
.
status
.
status
=
"
downloading
"
;
app
.
status
.
status
=
"
downloading
"
;
...
@@ -1047,9 +1055,17 @@ export class AppsService {
...
@@ -1047,9 +1055,17 @@ export class AppsService {
async
getChecksumFile
(
app
:
App
):
Promise
<
Map
<
string
,
string
>
>
{
async
getChecksumFile
(
app
:
App
):
Promise
<
Map
<
string
,
string
>
>
{
let
checksumUrl
=
this
.
checksumURL
+
app
.
id
;
let
checksumUrl
=
this
.
checksumURL
+
app
.
id
;
if
([
"
ygopro
"
,
'
desmume
'
].
includes
(
app
.
id
))
{
if
(
app
.
id
===
"
ygopro
"
)
{
let
locale
=
this
.
settingsService
.
getLocale
();
if
(
!
[
'
zh-CN
'
,
'
en-US
'
,
'
ja-JP
'
].
includes
(
locale
))
{
locale
=
'
en-US
'
;
}
checksumUrl
=
this
.
checksumURL
+
app
.
id
+
"
-
"
+
process
.
platform
+
'
-
'
+
locale
;
}
else
if
(
app
.
id
===
"
desmume
"
)
{
checksumUrl
=
this
.
checksumURL
+
app
.
id
+
"
-
"
+
process
.
platform
;
checksumUrl
=
this
.
checksumURL
+
app
.
id
+
"
-
"
+
process
.
platform
;
}
}
return
this
.
http
.
get
(
checksumUrl
)
return
this
.
http
.
get
(
checksumUrl
)
.
map
((
response
)
=>
{
.
map
((
response
)
=>
{
let
map
=
new
Map
<
string
,
string
>
();
let
map
=
new
Map
<
string
,
string
>
();
...
...
apps.json
View file @
51141dfe
...
@@ -2026,10 +2026,8 @@
...
@@ -2026,10 +2026,8 @@
},
},
"references"
:
{
"references"
:
{
"win32"
:
[
"win32"
:
[
"ygopro-lang-en-US"
],
],
"darwin"
:
[
"darwin"
:
[
"ygopro-lang-en-US"
]
]
},
},
"author"
:
"Fluorohydride"
,
"author"
:
"Fluorohydride"
,
...
@@ -2056,8 +2054,8 @@
...
@@ -2056,8 +2054,8 @@
}
}
},
},
"version"
:
{
"version"
:
{
"win32"
:
"1.033.C-
9
"
,
"win32"
:
"1.033.C-
15
"
,
"darwin"
:
"1.033.C-
9
"
"darwin"
:
"1.033.C-
15
"
},
},
"news"
:
{
"news"
:
{
"zh-CN"
:
[
"zh-CN"
:
[
...
@@ -2085,54 +2083,6 @@
...
@@ -2085,54 +2083,6 @@
},
},
"conference"
:
"ygopro_china_north"
"conference"
:
"ygopro_china_north"
},
},
{
"id"
:
"ygopro-lang-en-US"
,
"description"
:
{
"zh-CN"
:
"fxt desc"
},
"category"
:
"module"
,
"parent"
:
"ygopro"
,
"tags"
:
[
"language"
],
"dependencies"
:
{
"win32"
:
[
"ygopro"
],
"darwin"
:
[
"ygopro"
]
},
"references"
:
{
"win32"
:
[],
"darwin"
:
[]
},
"author"
:
"ZUN"
,
"homepage"
:
"http://www.myacg.cc"
,
"locales"
:
[
"en-US"
],
"actions"
:
{
"win32"
:
{
"main"
:
{
"execute"
:
"ygopro.exe"
,
"args"
:
[],
"env"
:
{}
}
},
"darwin"
:
{
"main"
:
{
"execute"
:
"ygopro.app/Contents/MacOS/ygopro"
,
"args"
:
[],
"env"
:
{}
}
}
},
"version"
:
{
"win32"
:
"1.033.C-9"
,
"darwin"
:
"1.033.C-9"
}
},
{
{
"id"
:
"desmume"
,
"id"
:
"desmume"
,
"name"
:
{
"name"
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment