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
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
syntax_j
mycard
Commits
8816b859
Commit
8816b859
authored
Dec 14, 2016
by
wudizhanche1000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整更新功能
parent
8646b9c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
app/apps.service.ts
app/apps.service.ts
+8
-9
No files found.
app/apps.service.ts
View file @
8816b859
...
...
@@ -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;
...
...
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