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
5525f86e
Commit
5525f86e
authored
Feb 19, 2013
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
0e4cffbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
lib/update.rb
lib/update.rb
+5
-4
No files found.
lib/update.rb
View file @
5525f86e
...
...
@@ -114,6 +114,7 @@ module Update
open
(
'http://my-card.in/cards/image.json'
)
do
|
f
|
image_index
=
JSON
.
parse
(
f
.
read
)
$log
.
info
(
'卡图路径'
){
image_index
}
url
=
image_index
[
'url'
]
uri
=
URI
(
url
)
image_req
=
uri
.
path
...
...
@@ -138,9 +139,9 @@ module Update
ids
=
[]
while
!
@thumbnails
.
empty?
ids
.
replace
@thumbnails
.
pop
(
100
)
reqs
=
ids
.
reverse
.
collect
{
|
id
|
Net
::
HTTP
::
Get
.
new
image
_req
.
gsub
(
':id'
,
id
.
to_s
)
}
reqs
=
ids
.
reverse
.
collect
{
|
id
|
Net
::
HTTP
::
Get
.
new
thumbnail
_req
.
gsub
(
':id'
,
id
.
to_s
)
}
http
.
pipeline
reqs
do
|
res
|
@status
.
replace
"正在下载
缩略卡图 (剩余
#{
@thumbnails_left
}
张
)"
@status
.
replace
"正在下载
卡图 (剩余: 缩略
#{
@thumbnails_left
}
/ 完整
#{
@images_left
}
)"
@thumbnails_left
-=
1
id
=
ids
.
pop
next
if
File
.
file?
"ygocore/pics/thumbnail/
#{
id
}
.jpg"
...
...
@@ -152,9 +153,9 @@ module Update
ids
=
[]
while
!
@images
.
empty?
ids
.
replace
@images
.
pop
(
100
)
reqs
=
ids
.
reverse
.
collect
{
|
id
|
Net
::
HTTP
::
Get
.
new
thumbnail
_req
.
gsub
(
':id'
,
id
.
to_s
)
}
reqs
=
ids
.
reverse
.
collect
{
|
id
|
Net
::
HTTP
::
Get
.
new
image
_req
.
gsub
(
':id'
,
id
.
to_s
)
}
http
.
pipeline
reqs
do
|
res
|
@status
.
replace
"正在下载
完整卡图 (剩余
#{
@images_left
}
张
)"
@status
.
replace
"正在下载
卡图 (剩余: 缩略
#{
@thumbnails_left
}
/ 完整
#{
@images_left
}
)"
@images_left
-=
1
id
=
ids
.
pop
next
if
File
.
file?
"ygocore/pics/
#{
id
}
.jpg"
...
...
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