bilibili_sunday 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -33,6 +33,7 @@ module BilibiliSunday
33
33
 
34
34
  videos.each do |cid|
35
35
  update_status(cid)
36
+ cleanup(cid)
36
37
  concat(cid) if (cache_completed?(cid) && (!concat_started?(cid)))
37
38
  end
38
39
  end
@@ -103,6 +104,17 @@ module BilibiliSunday
103
104
 
104
105
  private
105
106
 
107
+ def cleanup(cid)
108
+ if concat_completed?(cid)
109
+ # Deletes the partial files
110
+ downloads = load_yaml(downloads_yaml_path(cid))
111
+ downloads.each do |download|
112
+ path = download[:path]
113
+ FileUtils.rm(path) if File.exists?(path)
114
+ end
115
+ end
116
+ end
117
+
106
118
  def get_all_videos
107
119
  Dir.glob(File.join(video_store_path, '*')).select {|f| File.directory? f}.map { |f| File.basename(f).to_i }
108
120
  end
@@ -1,3 +1,3 @@
1
1
  module BilibiliSunday
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bilibili_sunday
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: