Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
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
MyCard
mycard
Commits
2a2847cb
Commit
2a2847cb
authored
Dec 14, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v3' of github.com:mycard/mycard into v3
parents
3b12e822
8816b859
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
app/apps.service.ts
app/apps.service.ts
+9
-10
No files found.
app/apps.service.ts
View file @
2a2847cb
...
...
@@ -332,6 +332,9 @@ export class AppsService {
}
else
{
readyToUpdate
=
app
.
isReady
()
&&
mods
.
every
((
mod
)
=>
mod
.
isReady
());
}
if
(
app
.
id
===
"
ygopro
"
)
{
console
.
log
(
111
);
}
if
(
readyToUpdate
&&
(
verify
||
app
.
local
!
.
version
!==
app
.
version
))
{
app
.
status
.
status
=
"
updating
"
;
try
{
...
...
@@ -348,15 +351,16 @@ export class AppsService {
let
deletedFiles
:
Set
<
string
>
=
new
Set
<
string
>
();
// 遍历寻找新增加的文件
for
(
let
[
file
,
checksum
]
of
latestFiles
)
{
if
(
!
localFiles
.
has
(
file
))
{
changedFiles
.
add
(
file
);
if
(
!
localFiles
.
has
(
file
)
&&
latestFiles
.
get
(
file
)
!==
""
)
{
addedFiles
.
add
(
file
);
// changedFiles包含addedFiles,addedFiles仅供mod更新的时候使用。
changedFiles
.
add
(
file
);
}
}
// 遍历寻找旧版本与新版本不一样的文件和新版本比旧版少了的文件
for
(
let
[
file
,
checksum
]
of
localFiles
)
{
if
(
latestFiles
.
has
(
file
))
{
if
(
latestFiles
.
get
(
file
)
!==
checksum
)
{
if
(
latestFiles
.
get
(
file
)
!==
checksum
&&
latestFiles
.
get
(
file
)
!==
""
)
{
changedFiles
.
add
(
file
);
}
}
else
{
...
...
@@ -364,11 +368,6 @@ export class AppsService {
}
}
// changedFiles包含addedFiles,addedFiles仅供mod更新的时候使用。
for
(
let
addedFile
of
addedFiles
)
{
changedFiles
.
add
(
addedFile
);
}
let
backupFiles
:
string
[]
=
[];
let
restoreFiles
:
string
[]
=
[];
if
(
app
.
parent
)
{
...
...
@@ -443,7 +442,7 @@ export class AppsService {
}
async
doUpdate
(
app
:
App
,
changedFiles
?:
Set
<
string
>
,
deletedFiles
?:
Set
<
string
>
)
{
const
updateServer
=
"
https://thief.mycard.moe/update/
metalinks/
"
;
const
updateServer
=
"
https://thief.mycard.moe/update/
"
;
if
(
changedFiles
&&
changedFiles
.
size
>
0
)
{
Logger
.
info
(
"
Update changed files:
"
,
changedFiles
);
let
updateUrl
=
updateServer
+
app
.
id
;
...
...
@@ -516,7 +515,7 @@ export class AppsService {
this
.
ref
.
tick
();
});
}
catch
(
e
)
{
throw
e
;
}
let
files
=
await
this
.
downloadService
.
getFiles
(
downloadId
);
app
.
status
.
status
=
"
waiting
"
;
...
...
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