getpics 0.2.2 → 0.2.3

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: f2489dc81725d6f88708240c5b40ad06984a1979d774a2dd37234c92b51b8eee
4
- data.tar.gz: a2c877a19df8c5c191b8c73ede24e0e5ee20d0a16cbdb0ef659a71cca52a7f65
3
+ metadata.gz: a4a68484d33a3cad5595e6036baf7d2a493b061222eb48937c6f91de4913c9db
4
+ data.tar.gz: c3951e050dc5248330154a5416935de5b2d258c3a283bd5e06a6499379a1d13d
5
5
  SHA512:
6
- metadata.gz: 0c3e8e5af759309849a530a5d955b4684ba23d2df0fd5b3fdd75ab645f076fb4dd8697775edbf99fe70930bd0ad5f047947166f4f5c435f8f4f96f2c0cfa1b41
7
- data.tar.gz: 7f140ef760fd6de21435abf871b7bf116993905635a3e2a598d6c397983977357839bdede11ce7fa0696c19fec6be0fd3ad83a9ed3b7c0044083d7cf651450fa
6
+ metadata.gz: 65e2bb98dfa3477a873b3de80a4bba4365ecbbc5c9cfc988dc3e931c8953e7096be92f1d7e77cf0c8c8508a693c78733b5be5169ec7e58bc89a4a7adcdecd64e
7
+ data.tar.gz: e033f49cc1382322be4835ee1249f1a838ef88fa2315ad636e8887afa7c13b76a149c2a6107362f2ea1202c7c3495cd7743ea33c19961f781781a88e8af7fb58
@@ -40,7 +40,15 @@ end.parse!
40
40
  dl = Getpics::Downloader.new(options[:verbose], options[:src], options[:photo_dest], options[:movie_dest])
41
41
  dl.load_media
42
42
  dl.copy_media
43
- dl.convert_media if options[:convert]
43
+ if dl.has_movies? and ! options[:convert]
44
+ puts "Do you want to convert movies to mp4? [Y/n]".yellow
45
+ convert = gets.strip
46
+ if convert != 'n'
47
+ dl.convert_media
48
+ end
49
+ elsif dl.has_movies? and options[:convert]
50
+ dl.convert_media
51
+ end
44
52
 
45
53
  puts "Do you want to delete the media from #{options[:src]}? [y/N]".yellow
46
54
  delete = gets.strip
@@ -35,7 +35,7 @@ module Getpics
35
35
 
36
36
  def copy_media
37
37
  puts "Copying media..."
38
- pb = ProgressBar.create(:title => "Media Copied", :total => @media_list.size)
38
+ pb = ProgressBar.create(:title => "Media Copied", :total => @media_list.size, :format => '%t: |%b%i| %c/%C %e')
39
39
  @media_list.all_known_media.each do |media|
40
40
  if ! File.exists?("#{media.target_path}")
41
41
  pb.log ("Copying #{media.path} to #{media.target_path}").light_black if @verbose
@@ -66,9 +66,10 @@ module Getpics
66
66
  end
67
67
  return if movies_to_process.size == 0
68
68
  puts "Converting movies to MP4..."
69
- pb = ProgressBar.create(:title => "Movies Converted", :total => movies_to_process.size)
69
+ pb = ProgressBar.create(:title => "Movies Converted", :total => movies_to_process.size, :format => '%t: |%b%i| %c/%C %e')
70
70
  movies_to_process.each do |movie|
71
- system("#{ffmpeg_path} -i #{movie.target_path} -vcodec copy -acodec copy #{dest_path}")
71
+ #system("#{ffmpeg_path} -i #{movie.target_path} -vcodec copy -acodec copy #{dest_path}")
72
+ system("#{ffmpeg_path} -i #{movie.target_path} -c:v libx264 -b:v 5200K -maxrate 5200K -bufsize 5200K -c:a aac -b:a 128K -ar 44100 #{dest_path}")
72
73
  pb.increment
73
74
  end
74
75
  end
@@ -83,6 +84,11 @@ module Getpics
83
84
  end
84
85
  end
85
86
 
87
+ def has_movies?
88
+ return true if @media_list.movies.size > 0
89
+ return false
90
+ end
91
+
86
92
  def delete_media
87
93
  @media_list.all_known_media.each do |media|
88
94
  puts "Deleting #{media.orig_path}".red if @verbose
@@ -89,7 +89,7 @@ module Getpics
89
89
  end
90
90
 
91
91
  def is_known?
92
- return true if @type.name != :unknown
92
+ return true if ! is_unknown?
93
93
  return false
94
94
  end
95
95
 
@@ -1,3 +1,3 @@
1
1
  module Getpics
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: getpics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug P.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-18 00:00:00.000000000 Z
11
+ date: 2018-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler