my-local-putio 4.3.0 → 4.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1fda9ccd9e21d1f3028968ec7a14e6457053553910740739fba4f5b56d39ea47
4
- data.tar.gz: d9299607c186f5c6cdb339c0e3d5a3e2075af67dc2ef3243fc0e282df65723d4
3
+ metadata.gz: d94ea788991c8c5098d95ab14f1bc81800f4ab11b26b73b9554a8a13bd58129f
4
+ data.tar.gz: 64e9f87e6498b45e1f18dd7148f5217f703a0ce6fff41caea329e8f9e89d9e05
5
5
  SHA512:
6
- metadata.gz: 0f4facdcd383dfc2c0f3a2e85e04617bf15c23b35a149a0f6686353406e15c3f96dc60588417f0858b65a7972674158a1b221d8053e8df84ce5e3c7c0bc3ba77
7
- data.tar.gz: 6497ba264ee6de19adfa927adb54ca118ec4a22993e6c37753277a3383b9ad5be7df04457574e67c9a097d742fa0f41828c3070be976004db1f4878bfe83ebe3
6
+ metadata.gz: df6785e66ff407966c5704f78b510708ec58032e81e1cbfeb18b51550c258d057902f79ed3f37adaef1fb31a637623993355b8e4f3e4047a46c97dbe2369f716
7
+ data.tar.gz: ee9cfad26ff5f473a00067679113250b3c4f3c0f36bd0d87010795d3489e9061fd7d6e87de686062140824a6524510467221702aa6409689c30e47fbffa49542
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # v4.3.1
2
+
3
+ - Bugfix: Already downloaded files no longer need to be downloaded again
4
+ - No parameter is necessary this is the default behaviour
5
+ - The codes matches the name and the filesize
6
+
1
7
  # v4.3.0
2
8
 
3
9
  - Introducing --disk-threshold
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- my-local-putio (4.2.0)
4
+ my-local-putio (4.3.1)
5
5
  socksify (= 1.7.1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -57,7 +57,7 @@ Examples:
57
57
  my-local-putio -t 123 -l Downloads
58
58
  my-local-putio -l Downloads --token 123
59
59
  my-local-putio -l Downloads -t token123 -d -s --socks5-proxy 127.0.0.1:1234
60
- my-local-putio -d -s --disk-threshold size 1000
60
+ my-local-putio -d -s --disk-threshold 1000
61
61
 
62
62
  With Token variable (inline or exporting):
63
63
 
@@ -85,11 +85,11 @@ Examples:
85
85
  my-local-putio -l Downloads -t 123 --temp-destination /tmp --with-subtitles
86
86
  my-local-putio --local-destination Downloads -t 123 --debug --with-subtitles
87
87
  my-local-putio --local-destination Downloads -t 123 --socks5-proxy 127.0.0.1:3333
88
- my-local-putio -d -s --disk-threshold size 1000
88
+ my-local-putio -d -s --disk-threshold 1000
89
89
 
90
90
  Verbose output example:
91
91
 
92
- my-local-putio -t 123 -l Downloads -d -s --socks5-proxy 127.0.0.1:3333 --temp-destination /tmp --disk-threshold size 2000
92
+ my-local-putio -t 123 -l Downloads -d -s --socks5-proxy 127.0.0.1:3333 --temp-destination /tmp --disk-threshold 2000
93
93
 
94
94
  Starting My Local Put.io - version 4.3.0
95
95
  https://github.com/rafaelbiriba/my-local-putio
@@ -27,27 +27,28 @@ module MyLocalPutio
27
27
  end
28
28
 
29
29
  def process_file(file, path)
30
- local_file_path = File.join(path, file.name)
30
+ file_path = File.join(path, file.name)
31
31
  if file.content_type == "application/x-directory"
32
- fetch_files(id: file.id, path: local_file_path)
32
+ fetch_files(id: file.id, path: file_path)
33
33
  else
34
34
  url = cli.get_download_url(file.id)["url"]
35
35
  disk_manager.check_for_available_space_on_destinations!(file.size/1024/1024)
36
- Downloader.new(@configuration).download(url, local_file_path) unless file_exists?(local_file_path, file)
36
+ Downloader.new(@configuration).download(url, file_path) unless file_exists?(file_path, file)
37
37
  SubtitlesManager.new(configuration).fetch(file, path)
38
38
  end
39
- delete_file(local_file_path, file)
39
+ delete_file(file_path, file)
40
40
  end
41
41
 
42
- def delete_file(local_file_path, file)
42
+ def delete_file(file_path, file)
43
43
  return unless configuration.delete_remote
44
- logger.log "Deleting remote #{file.file_type.downcase}: #{local_file_path}"
44
+ logger.log "Deleting remote #{file.file_type.downcase}: #{file_path}"
45
45
  cli.delete_file(file.id)
46
46
  end
47
47
 
48
- def file_exists?(local_file_path, file)
49
- file_exists = File.exists?(local_file_path) && File.size(local_file_path) == file.size
50
- logger.log "File already downloaded #{local_file_path}" if file_exists
48
+ def file_exists?(file_path, file)
49
+ local_full_path = File.join(configuration.local_destination, file_path)
50
+ file_exists = File.exists?(local_full_path) && File.size(local_full_path)/1024 == file.size/1024
51
+ logger.log "File already downloaded #{file_path}" if file_exists
51
52
  file_exists
52
53
  end
53
54
  end
@@ -1,3 +1,3 @@
1
1
  module MyLocalPutio
2
- VERSION = "4.3.0"
2
+ VERSION = "4.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my-local-putio
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Biriba
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-07 00:00:00.000000000 Z
11
+ date: 2020-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler