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
30febea8
Commit
30febea8
authored
Dec 07, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate
parent
720fb8f4
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
372 additions
and
8 deletions
+372
-8
app/apps.service.ts
app/apps.service.ts
+29
-8
app/lobby.component.ts
app/lobby.component.ts
+1
-0
db.json
db.json
+342
-0
No files found.
app/apps.service.ts
View file @
30febea8
...
...
@@ -47,14 +47,35 @@ export class AppsService {
private
downloadService
:
DownloadService
)
{
}
loadApps
()
{
return
this
.
http
.
get
(
'
./apps.json
'
)
.
toPromise
()
.
then
((
response
)
=>
{
let
data
=
response
.
json
();
async
loadApps
()
{
let
data
=
await
this
.
http
.
get
(
'
./apps.json
'
).
map
((
response
)
=>
response
.
json
()).
toPromise
();
this
.
apps
=
this
.
loadAppsList
(
data
);
return
this
.
apps
;
});
}
async
migrate
()
{
await
this
.
migrate_v2_ygopro
();
await
this
.
migreate_default_library
();
}
async
migrate_v2_ygopro
()
{
// 导入萌卡 v2 的 YGOPRO
try
{
const
legacy_ygopro_path
=
require
(
path
.
join
(
'
db.json
'
)).
local
.
ygopro
.
path
;
if
(
legacy_ygopro_path
)
{
// 导入YGOPRO
}
}
catch
(
error
)
{
}
}
async
migreate_default_library
()
{
let
default_library
=
this
.
settingsService
.
getDefaultLibrary
();
if
(
default_library
.
path
==
path
.
join
(
remote
.
app
.
getPath
(
"
appData
"
),
"
library
"
))
{
default_library
.
path
=
path
.
join
(
remote
.
app
.
getPath
(
"
appData
"
),
"
MyCardLibrary
"
)
}
this
.
settingsService
.
setDefaultLibrary
(
default_library
);
}
loadAppsList
=
(
data
:
any
):
Map
<
string
,
App
>
=>
{
...
...
app/lobby.component.ts
View file @
30febea8
...
...
@@ -29,6 +29,7 @@ export class LobbyComponent implements OnInit {
async
ngOnInit
()
{
this
.
apps
=
await
this
.
appsService
.
loadApps
();
await
this
.
appsService
.
migrate
();
this
.
chooseApp
(
Array
.
from
(
this
.
apps
.
values
()).
find
(
app
=>
app
.
isInstalled
())
||
this
.
apps
.
get
(
"
ygopro
"
)
!
);
// 初始化聊天室
...
...
db.json
0 → 100644
View file @
30febea8
This diff is collapsed.
Click to expand it.
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