javlibrary 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1c52575670f70ee6bb58c218ffd1b4bfd9df7fd
4
- data.tar.gz: 608214bf9f3acf2f2e619c866e697bf754279363
3
+ metadata.gz: 9eccb00912d355abe97bbfc69fda2c5455acca48
4
+ data.tar.gz: c1955ec501ab0cdfa098871c766a06acdbf480d0
5
5
  SHA512:
6
- metadata.gz: c559387f18f26f1640d2d63f88e94fa2fd83ad41fef63eb9164b41589ae8eadf991136ba155e475d4889cbbfe2df1c46d70511122914c1f946fc334b4ac5fd1b
7
- data.tar.gz: 26ab6d969cc65d4eb91feaa9a57b33323a30ab34156c0a407daca0a9158087eec849e4c7c8152038deefc7c967f25ff11462ee8dc4eeeb11f6fac1e8cd87aa7a
6
+ metadata.gz: 36d0bb16e9aec71b743f9fdeb605f679f638ce152b2060fc9b566b078a1083ca81b12d339a653d94d9defefaf150ab4cef3bc8a5f1df47151411d5c7bf83989d
7
+ data.tar.gz: c38c3768171a33fb7c803e354f050ccb61d6d702d253c66560e07052fd3364fe8abface55f9e19821abe824ea49406726dad5ad8a0b1beacc8ecf4d6eb8ec30a
@@ -16,7 +16,7 @@ class Javlibrary
16
16
  @password = pwd
17
17
 
18
18
  # Define default Javlibrary url
19
- @url = JAVLIBRARY_URL[0]
19
+ @url = JAVLIBRARY_URL[1]
20
20
  end
21
21
 
22
22
  attr_accessor :database, :username, :password, :url
@@ -66,7 +66,10 @@ class Javlibrary
66
66
  end
67
67
 
68
68
  def video_info_insert(client, index, identifer, actor_hash, genres_hash)
69
- title, id, date, director, maker, label, cast_tmp, genres_tmp, img_url = downloader(identifer).split('$')
69
+ result = downloader(identifer)
70
+ return nil if result == nil
71
+
72
+ title, id, date, director, maker, label, cast_tmp, genres_tmp, img_url = result.split('$')
70
73
  cast = cast_tmp.split.reject(&:empty?)
71
74
  genres = genres_tmp.split.reject(&:empty?)
72
75
  begin
@@ -88,7 +91,6 @@ class Javlibrary
88
91
  end
89
92
 
90
93
  client.query("UPDATE label SET video_download=1 WHERE video_num=#{index}")
91
- client.close
92
94
  end
93
95
 
94
96
  def download_all_videos
@@ -110,7 +112,7 @@ class Javlibrary
110
112
  video_array.each do |group|
111
113
  # Create a download thread
112
114
  thread_temp = Thread.new {
113
- client = client
115
+ client = client()
114
116
  group.each do |item|
115
117
  begin
116
118
  video_info_insert(client, item['video_num'], item['video_label'],
@@ -120,7 +122,6 @@ class Javlibrary
120
122
  end
121
123
  end
122
124
  client.close
123
- GC.start
124
125
  }
125
126
  thread_pool << thread_temp
126
127
  end
@@ -1,3 +1,3 @@
1
1
  class Javlibrary
2
- VERSION = "0.2.10"
2
+ VERSION = "0.2.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: javlibrary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.10
4
+ version: 0.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuanhao Sun